diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..e4f374e --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,19 @@ +# Keeps the SHA-pinned actions in publish.yml patched. +version: 2 + +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + commit-message: + prefix: "ci" + labels: + - "dependencies" + - "github-actions" + groups: + actions-minor-and-patch: + update-types: + - "minor" + - "patch" + open-pull-requests-limit: 5 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a8fa1c3..42350c2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,8 +24,8 @@ jobs: node: [18, 20, 22] steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 with: node-version: ${{ matrix.node }} cache: npm diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 7c60895..6a46234 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -41,10 +41,10 @@ jobs: REF: ${{ github.event.release.tag_name || github.sha }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: ref: ${{ github.event.release.tag_name || github.sha }} - - uses: actions/setup-node@v4 + - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 with: node-version: 20 cache: npm @@ -76,11 +76,11 @@ jobs: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: ref: ${{ github.event.release.tag_name }} - - uses: actions/setup-node@v4 + - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 with: node-version: 22 # trusted publishing needs >= 22.14 cache: npm @@ -172,9 +172,9 @@ jobs: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - uses: actions/setup-node@v4 + - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 with: node-version: 22 # trusted publishing needs >= 22.14 cache: npm @@ -268,3 +268,46 @@ jobs: curl -s -X POST "$SLACK_WEBHOOK_URL" \ -H 'Content-type: application/json' \ --data "{\"text\":\"*plain-forge*: prerelease of \`${GITHUB_SHA:0:7}\` FAILED :x:. \`latest\` is unaffected. See <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|the run log>.\"}" + + # Release pipelines to be turned on only after the rest of the infrastructure + # is ready. + # + # # Its own job: the publish job holds id-token: write for trusted publishing, and + # # recording a release needs none of it. + # linear-release: + # name: Record release in Linear + # needs: publish + # runs-on: ubuntu-latest + # + # permissions: + # contents: read + # + # env: + # SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + # + # steps: + # - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + # with: + # ref: ${{ github.event.release.tag_name }} + # # The scan needs full history. + # fetch-depth: 0 + # + # # Non-fatal: the package is already on npm. + # - name: Record release in Linear + # id: linear + # continue-on-error: true + # uses: linear/linear-release-action@0a25abab892a91062ebf42260dbb2ce6277aa205 # v0.16.0 + # with: + # access_key: ${{ secrets.LINEAR_ACCESS_KEY }} + # version: ${{ github.event.release.tag_name }} + # # Pin the CLI the action downloads, not just the action. + # cli_version: v0.16.0 + # + # # continue-on-error keeps the job green, so this checks the step's own + # # outcome — `failure()` would never fire. + # - name: Notify Slack (release not recorded) + # if: ${{ steps.linear.outcome == 'failure' && env.SLACK_WEBHOOK_URL != '' }} + # run: | + # curl -s -X POST "$SLACK_WEBHOOK_URL" \ + # -H 'Content-type: application/json' \ + # --data "{\"text\":\"*plain-forge*: \`${{ github.event.release.tag_name }}\` is on npm, but recording it in Linear FAILED :warning:. See <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|the run log>.\"}" diff --git a/RELEASING.md b/RELEASING.md index 35f46b8..b29b972 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -160,7 +160,8 @@ at the repo root — gitignored, and the only place a webhook should live locall | what | where | note | |---|---|---| | Trusted publisher | npmjs.com → `plain-forge` → Settings → Trusted Publisher | GitHub Actions, `plainlang/plain-forge`, workflow `publish.yml` | -| `SLACK_WEBHOOK_URL` | repo secret | the only secret this repo has; notifications are skipped without it | +| `SLACK_WEBHOOK_URL` | repo secret | notifications are skipped without it | +| `LINEAR_ACCESS_KEY` | repo secret | records the release in Linear; the job is currently commented out in `publish.yml` | | Branch protection | `main` | `Test (node 18 / 20 / 22)` required, no force pushes, no deletion | **The workflow filename is part of the trust contract.** Renaming `publish.yml` breaks