fix(disk buffer): record drop_newest discards from disk buffers #17696
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Call Build Preview | |
| on: | |
| pull_request: | |
| types: [opened, reopened, synchronize, labeled, unlabeled] | |
| # Restrictive default permissions | |
| permissions: | |
| contents: read # Required for repository context | |
| jobs: | |
| approval_check: | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 5 | |
| permissions: | |
| contents: read # Required for repository context | |
| actions: write # Required to upload artifacts that trigger the preview build workflow | |
| # Only run when at least one "preview: <app>" label is present | |
| if: >- | |
| ${{ | |
| contains(github.event.pull_request.labels.*.name, 'preview: website') || | |
| contains(github.event.pull_request.labels.*.name, 'preview: playground') || | |
| contains(github.event.pull_request.labels.*.name, 'preview: rust-doc') | |
| }} | |
| steps: | |
| # Save PR information. The raw branch name is only ever written as file data, hashed for | |
| # the integrity check, or sanitized (see create_preview_sites.yml) before it reaches a URL, | |
| # so there's nothing here to reject it against. | |
| - name: Save PR information | |
| uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 | |
| with: | |
| script: | | |
| const fs = require('fs').promises; | |
| const path = require('path'); | |
| const crypto = require('crypto'); | |
| const prNumber = context.payload.number; | |
| const branchName = context.payload.pull_request.head.ref; | |
| const labelNames = context.payload.pull_request.labels.map(l => l.name); | |
| const apps = { | |
| website: labelNames.includes('preview: website'), | |
| playground: labelNames.includes('preview: playground'), | |
| rustDoc: labelNames.includes('preview: rust-doc'), | |
| }; | |
| await fs.mkdir('./pr', { recursive: true }); | |
| await fs.writeFile('./pr/number', prNumber.toString()); | |
| await fs.writeFile('./pr/branch', branchName); | |
| await fs.writeFile('./pr/apps', JSON.stringify(apps)); | |
| const numberHash = crypto.createHash('sha256').update(prNumber.toString()).digest('hex'); | |
| const branchHash = crypto.createHash('sha256').update(branchName).digest('hex'); | |
| await fs.writeFile('./pr/integrity', `${numberHash}:${branchHash}`); | |
| core.info(`Saved PR #${prNumber}, branch ${branchName}, apps ${JSON.stringify(apps)}`); | |
| # Upload the artifact using latest version | |
| - name: Upload PR information artifact | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: pr | |
| path: pr/ | |
| retention-days: 1 |