Skip to content

Commit 6889a79

Browse files
ci(rust): Run CI against toolchain update bot PRs (#2779)
The PRs from the Rust toolchain update bot don't trigger the `pull_request`-triggered workflows. This is a [GitHub feature, not a bug.](https://docs.github.com/en/actions/concepts/security/github_token?utm_source=chatgpt.com#when-github_token-triggers-workflow-runs) This change adds a `workflow_dispatch` trigger to our CI action, and has the Rust toolchain update bot automatically trigger the action after opening the PR. I tested this change with #2781. Although the workflow run does not show on that PR, we can see that, in fact, the [CI did run](https://github.com/getsentry/sentry-cli/actions/runs/17911030223) against the commit. My guess is maybe it has to do with the fact that the #2781 is against #2780, rather than the `master` branch.
1 parent 8db571b commit 6889a79

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ on:
99

1010
pull_request:
1111

12+
workflow_dispatch:
13+
1214
concurrency:
1315
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
1416
cancel-in-progress: true

.github/workflows/rust-toolchain-update.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ jobs:
1313
permissions:
1414
contents: write
1515
pull-requests: write
16+
actions: write
1617

1718
steps:
1819
- name: Checkout Repository
@@ -127,3 +128,12 @@ jobs:
127128
});
128129
129130
console.log(`Created PR #${pr.number}: ${pr.title}`);
131+
132+
// Run the CI workflow on the PR branch. Needed because GITHUB_TOKEN
133+
// doesn't trigger workflows, except for workflow_dispatch.
134+
await github.rest.actions.createWorkflowDispatch({
135+
owner: context.repo.owner,
136+
repo: context.repo.repo,
137+
workflow_id: 'ci.yml',
138+
ref: branchName,
139+
});

0 commit comments

Comments
 (0)