Skip to content

ci: add pull_request trigger to enable CI on fork PRs#3782

Merged
aterga merged 4 commits intodfinity:mainfrom
aterga:ci-pr-trigger-for-forks
Apr 16, 2026
Merged

ci: add pull_request trigger to enable CI on fork PRs#3782
aterga merged 4 commits intodfinity:mainfrom
aterga:ci-pr-trigger-for-forks

Conversation

@aterga
Copy link
Copy Markdown
Collaborator

@aterga aterga commented Apr 16, 2026

Summary

  • Add pull_request trigger to canister-tests.yml, frontend-checks.yml, and rust.yml
  • Currently these workflows only trigger on push, so fork PRs never get CI checks
  • With pull_request added, maintainers see an "Approve and run" button to trigger CI on external contributions

Notes

  • Some jobs reference secrets.GIX_BOT_PAT, which is not available to pull_request runs from forks. Steps that depend on this token (e.g., auto-commit formatting fixes) will be skipped or fail on fork PRs, but the core checks (build, test, lint) should still work.
  • The repo setting at Settings > Actions > General > Fork pull request workflows controls which contributors require approval.

Currently CI only runs on push, which means fork PRs never get checks.
Adding pull_request trigger enables the "Approve and run" flow for
maintainers to approve CI on external contributions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
aterga and others added 2 commits April 16, 2026 13:48
Fork PR runs don't have access to repo secrets, so the checkout step
fails with "Input required and not supplied: token". Using a fallback
expression lets the checkout succeed with the default token on fork PRs
while preserving the PAT behavior on push events.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The release job tries to create a GitHub release, which fails on fork
PRs due to insufficient permissions. Guard it with an event check so it
only runs on push events, matching the deploy job's existing pattern.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@aterga aterga marked this pull request as ready for review April 16, 2026 14:29
@aterga aterga requested a review from a team as a code owner April 16, 2026 14:29
@aterga aterga requested review from Copilot and sea-snake April 16, 2026 14:29
@dfinity dfinity deleted a comment from cla-idx-bot bot Apr 16, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Enables CI to run for pull requests (including from forks) by adding pull_request triggers to existing push-only workflows, and preventing release automation from running in PR contexts.

Changes:

  • Add pull_request triggers to Rust, frontend, and canister test workflows.
  • Use a fallback checkout token (github.token) when secrets.GIX_BOT_PAT is unavailable (e.g., fork PRs).
  • Skip the canister release job on pull_request events.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
.github/workflows/rust.yml Adds PR trigger and fallback checkout token for fork PR execution.
.github/workflows/frontend-checks.yml Adds PR trigger and fallback checkout token for fork PR execution.
.github/workflows/canister-tests.yml Adds PR trigger and prevents release automation from running on PR events.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/frontend-checks.yml
Comment thread .github/workflows/rust.yml
sea-snake
sea-snake previously approved these changes Apr 16, 2026
Fork PRs have read-only tokens and run on a detached merge ref, so the
auto-commit steps for formatting and type generation would fail. Restrict
them to push events only.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions github-actions bot dismissed sea-snake’s stale review April 16, 2026 14:44

Review dismissed by automation script.

@aterga aterga requested a review from Copilot April 16, 2026 14:45
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/canister-tests.yml
Comment thread .github/workflows/rust.yml
Comment thread .github/workflows/frontend-checks.yml
@aterga aterga enabled auto-merge April 16, 2026 15:05
@aterga aterga requested a review from sea-snake April 16, 2026 15:06
@aterga aterga added this pull request to the merge queue Apr 16, 2026
Merged via the queue into dfinity:main with commit 2b3bd3c Apr 16, 2026
49 checks passed
@aterga aterga deleted the ci-pr-trigger-for-forks branch April 16, 2026 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants