Skip to content

Commit a984306

Browse files
Ensure bump PR required checks are always triggered
1 parent a67a1d4 commit a984306

File tree

4 files changed

+31
-2
lines changed

4 files changed

+31
-2
lines changed

.github/workflows/check.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
branches: [main]
66
push:
77
branches: [main]
8+
workflow_dispatch:
89

910
permissions:
1011
contents: read

.github/workflows/publish-package.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ concurrency:
99
cancel-in-progress: false
1010

1111
permissions:
12+
actions: write
1213
contents: write
1314
pull-requests: write
1415
packages: write
@@ -125,6 +126,7 @@ jobs:
125126
runs-on: blacksmith-4vcpu-ubuntu-2404
126127
needs: resolve-merge-context
127128
permissions:
129+
actions: write
128130
contents: write
129131
pull-requests: write
130132
packages: write
@@ -316,3 +318,22 @@ jobs:
316318
- Next stable version prepared: `${{ steps.meta.outputs.next_stable_version }}`
317319
add-paths: |
318320
package.json
321+
322+
- name: Trigger required checks for bump PR
323+
if: steps.meta.outputs.create_bump_pr == 'true'
324+
env:
325+
GH_TOKEN: ${{ secrets.GH_PAT || secrets.GITHUB_TOKEN }}
326+
REPO: ${{ github.repository }}
327+
BUMP_BRANCH: ci/version-bump-${{ steps.meta.outputs.next_stable_version }}
328+
BUMP_TITLE: chore: bump package version to ${{ steps.meta.outputs.next_stable_version }}
329+
run: |
330+
gh api \
331+
--method POST \
332+
"repos/${REPO}/actions/workflows/check.yml/dispatches" \
333+
-f ref="${BUMP_BRANCH}"
334+
335+
gh api \
336+
--method POST \
337+
"repos/${REPO}/actions/workflows/validate-pr-title.yml/dispatches" \
338+
-f ref="${BUMP_BRANCH}" \
339+
-F inputs[pr_title]="${BUMP_TITLE}"

.github/workflows/validate-pr-title.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ name: ValidatePrTitle
33
on:
44
pull_request:
55
types: [opened, edited, synchronize, reopened]
6+
workflow_dispatch:
7+
inputs:
8+
pr_title:
9+
description: "Pull request title to validate"
10+
required: true
11+
type: string
612

713
permissions:
814
pull-requests: read
@@ -14,7 +20,7 @@ jobs:
1420
steps:
1521
- name: Validate pull request title
1622
env:
17-
PR_TITLE: ${{ github.event.pull_request.title }}
23+
PR_TITLE: ${{ github.event_name == 'pull_request' && github.event.pull_request.title || inputs.pr_title }}
1824
run: |
1925
title="${PR_TITLE}"
2026
if [ -z "${title// /}" ]; then

RELEASE.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,10 @@ Workflow: `.github/workflows/publish-package.yml`
2828
## Required Repository Configuration
2929

3030
- GitHub Actions:
31-
- `GITHUB_TOKEN` must keep `contents:write`, `pull-requests:write`, `packages:write` permissions in `publish-package.yml`.
31+
- `GITHUB_TOKEN` must keep `actions:write`, `contents:write`, `pull-requests:write`, `packages:write` permissions in `publish-package.yml`.
3232
- Optional token:
3333
- `GH_PAT` can be set to let `create-pull-request` use a PAT instead of `GITHUB_TOKEN`.
34+
- 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.
3435
- Branch governance:
3536
- Keep required checks enforced for PRs into `main`:
3637
- `Check`

0 commit comments

Comments
 (0)