Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
55 changes: 49 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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>.\"}"
3 changes: 2 additions & 1 deletion RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down