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
1 change: 1 addition & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches: [main]
push:
branches: [main]
workflow_dispatch:

permissions:
contents: read
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/publish-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ concurrency:
cancel-in-progress: false

permissions:
actions: write
contents: write
pull-requests: write
packages: write
Expand Down Expand Up @@ -125,6 +126,7 @@ jobs:
runs-on: blacksmith-4vcpu-ubuntu-2404
needs: resolve-merge-context
permissions:
actions: write
contents: write
pull-requests: write
packages: write
Expand Down Expand Up @@ -316,3 +318,22 @@ jobs:
- Next stable version prepared: `${{ steps.meta.outputs.next_stable_version }}`
add-paths: |
package.json

- name: Trigger required checks for bump PR
if: steps.meta.outputs.create_bump_pr == 'true'
env:
GH_TOKEN: ${{ secrets.GH_PAT || secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
BUMP_BRANCH: ci/version-bump-${{ steps.meta.outputs.next_stable_version }}
BUMP_TITLE: chore: bump package version to ${{ steps.meta.outputs.next_stable_version }}
run: |
gh api \
--method POST \
"repos/${REPO}/actions/workflows/check.yml/dispatches" \
-f ref="${BUMP_BRANCH}"

gh api \
--method POST \
"repos/${REPO}/actions/workflows/validate-pr-title.yml/dispatches" \
-f ref="${BUMP_BRANCH}" \
-F inputs[pr_title]="${BUMP_TITLE}"
8 changes: 7 additions & 1 deletion .github/workflows/validate-pr-title.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ name: ValidatePrTitle
on:
pull_request:
types: [opened, edited, synchronize, reopened]
workflow_dispatch:
inputs:
pr_title:
description: "Pull request title to validate"
required: true
type: string

permissions:
pull-requests: read
Expand All @@ -14,7 +20,7 @@ jobs:
steps:
- name: Validate pull request title
env:
PR_TITLE: ${{ github.event.pull_request.title }}
PR_TITLE: ${{ github.event_name == 'pull_request' && github.event.pull_request.title || inputs.pr_title }}
run: |
title="${PR_TITLE}"
if [ -z "${title// /}" ]; then
Expand Down
3 changes: 2 additions & 1 deletion RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ Workflow: `.github/workflows/publish-package.yml`
## Required Repository Configuration

- GitHub Actions:
- `GITHUB_TOKEN` must keep `contents:write`, `pull-requests:write`, `packages:write` permissions in `publish-package.yml`.
- `GITHUB_TOKEN` must keep `actions:write`, `contents:write`, `pull-requests:write`, `packages:write` permissions in `publish-package.yml`.
- Optional token:
- `GH_PAT` can be set to let `create-pull-request` use a PAT instead of `GITHUB_TOKEN`.
- If `GH_PAT` is not available, publish automation dispatches `Check` and `ValidatePrTitle` workflows directly on the bump branch so required checks still attach to the bump PR head commit.
- Branch governance:
- Keep required checks enforced for PRs into `main`:
- `Check`
Expand Down