-
Notifications
You must be signed in to change notification settings - Fork 0
fix: close the four deferred issues — and two of them were not what their issue said #163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| # Asks npm what it actually holds, and opens an issue when it disagrees with this tree. | ||
| # | ||
| # NOT a step of `x verify`, and it must never become one. The gate is the shippability contract and | ||
| # runs on free runners; a step that resolves the network makes green depend on something the runner | ||
| # does not control. More to the point, a gate step could not do this job anyway: the three states | ||
| # this catches all appear BETWEEN commits, not at one. | ||
| # | ||
| # The state it exists for: a package added after a release run is unpublished until a human | ||
| # bootstraps it, and nothing says so until the next release reaches it and aborts with everything | ||
| # ahead of it already published irreversibly. `@ultimat3/flags` sat that way until 2.0.0 and | ||
| # `@ultimat3/scraping` until 2026-08-19, each while the docs described the other. | ||
|
|
||
| name: registry-audit | ||
|
|
||
| on: | ||
| schedule: | ||
| # Daily, well away from the hour a release is likely to be cut by hand. | ||
| - cron: '17 6 * * *' | ||
| workflow_dispatch: | ||
|
|
||
| # Read-only: it resolves npm and may open an issue. It never publishes, and it holds no | ||
| # `id-token`, so it cannot be a path to the registry even if it is compromised. | ||
| permissions: | ||
| contents: read | ||
| issues: write | ||
|
|
||
| concurrency: | ||
| group: registry-audit | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| audit: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v7 | ||
| - uses: ./.github/actions/setup | ||
|
|
||
| - name: audit the registry | ||
| id: audit | ||
| # `pipefail` is load-bearing: without it `tee` decides the step's exit status, the audit's | ||
| # non-zero is discarded, `outcome` is always `success`, and every step below that keys on | ||
| # `failure` never runs — a workflow that reports clean whatever npm says. | ||
| shell: bash | ||
| run: | | ||
| set -o pipefail | ||
| bun run scripts/registry-audit.ts --json | tee audit.json | ||
| continue-on-error: true | ||
|
|
||
| - name: open an issue when the registry disagrees | ||
| if: steps.audit.outcome == 'failure' | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| # One open issue at a time: a daily job that files a duplicate every morning trains everyone | ||
| # to ignore it, which is the failure mode this audit exists to correct. | ||
| run: | | ||
| existing="$(gh issue list --label registry-drift --state open --limit 1 --json number --jq '.[0].number // empty')" | ||
| summary="$(jq -r '.summary' audit.json)" | ||
| body="$(jq -r '"**" + .summary + "**\n\n" + ([.findings[] | "- `" + .code + "` " + (.at // "") + " — " + .cause + "\n - fix: `" + .fix + "`"] | join("\n"))' audit.json)" | ||
| if [ -n "$existing" ]; then | ||
| gh issue comment "$existing" --body "$body" | ||
| else | ||
| gh issue create --label registry-drift --title "registry: $summary" --body "$body" | ||
| fi | ||
|
|
||
| - name: fail the run so the badge is honest | ||
| if: steps.audit.outcome == 'failure' | ||
| run: exit 1 | ||
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
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.