Skip to content

fix(ci): add repository check to prevent workflows from running on forks - #5391

Closed
Wu-Jiayang wants to merge 9 commits into
google:mainfrom
Wu-Jiayang:fix/workflow-fork-protection
Closed

Wu-Jiayang wants to merge 9 commits into
google:mainfrom
Wu-Jiayang:fix/workflow-fork-protection

Conversation

@Wu-Jiayang

@Wu-Jiayang Wu-Jiayang commented Apr 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add if: github.repository == 'google/adk-python' guard to 3 workflows that lack this protection: v2-sync, issue-monitor, and copybara-pr-handler
  • These workflows use secrets unavailable on forks (RELEASE_PAT, ADK_TRIAGE_AGENT, GOOGLE_API_KEY), causing daily failures on forks

Context

Other scheduled/repo-specific workflows (triage.yml, stale-bot.yml, upload-adk-docs-to-vertex-ai-search.yml) already have this guard. These 3 were missing it, causing errors on forks every day.

Testing Plan

  • Verified that the added condition matches the existing pattern used in triage.yml, stale-bot.yml, and upload-adk-docs-to-vertex-ai-search.yml
  • On forks, the job will be skipped (same behavior as the already-protected workflows)
  • On google/adk-python, the workflows will continue to run as before since the condition evaluates to true

Add if: github.repository == 'google/adk-python' guard to workflows
that lack this protection: v2-sync, issue-monitor, and copybara-pr-handler.
These workflows use secrets unavailable on forks, causing daily failures.
@adk-bot

adk-bot commented Apr 19, 2026

Copy link
Copy Markdown
Collaborator

Response from ADK Triaging Agent

Hello @Wu-Jiayang, thank you for creating this PR!

Could you please include a testing plan section in your PR to describe how you tested these changes?

This information will help reviewers to review your PR more efficiently. Thanks!

@adk-bot adk-bot added the tools [Component] This issue is related to tools label Apr 19, 2026
@Wu-Jiayang

Copy link
Copy Markdown
Contributor Author

Hi @adk-bot, I've added a Testing Plan section to the PR description. Please take a look, thanks!

@rohityan rohityan self-assigned this Apr 20, 2026
@rohityan

Copy link
Copy Markdown
Collaborator

Hi @Wu-Jiayang , Thank you for your contribution! We appreciate you taking the time to submit this pull request. You could manually disable the workflows on your fork.

@rohityan rohityan added the request clarification [Status] The maintainer need clarification or more information from the author label Apr 27, 2026
@Wu-Jiayang

Copy link
Copy Markdown
Contributor Author

I’ve already disabled it in my own fork, but I still think it should be handled via a PR for consistency, since the other workflows are checked as well. @rohityan

@rohityan rohityan added needs review [Status] The PR/issue is awaiting review from the maintainer and removed request clarification [Status] The maintainer need clarification or more information from the author labels May 8, 2026
@rohityan rohityan assigned Jacksunwei and unassigned Jacksunwei May 8, 2026
@rohityan
rohityan requested a review from Jacksunwei May 8, 2026 23:28
@rohityan

rohityan commented May 8, 2026

Copy link
Copy Markdown
Collaborator

Hi @Jacksunwei , can you please review this. LGTM

Wu-Jiayang and others added 4 commits May 21, 2026 00:11
The unquoted colon in the workflow's `name` field made the YAML
unparseable: GitHub Actions rejected the file with "mapping values
are not allowed here" and produced a run with zero jobs, while
pre-commit's `check-yaml` hook failed with the same error on push.
Wrapping the value in double quotes lets both parsers accept the file.
@Wu-Jiayang

Copy link
Copy Markdown
Contributor Author

@wyf7107 I found a bug from you and fixed it.

copybara-service Bot pushed a commit that referenced this pull request Jun 12, 2026
Merge #5391

## Summary

- Add `if: github.repository == 'google/adk-python'` guard to 3 workflows that lack this protection: v2-sync, issue-monitor, and copybara-pr-handler
- These workflows use secrets unavailable on forks (RELEASE_PAT, ADK_TRIAGE_AGENT, GOOGLE_API_KEY), causing daily failures on forks

## Context

Other scheduled/repo-specific workflows (triage.yml, stale-bot.yml, upload-adk-docs-to-vertex-ai-search.yml) already have this guard. These 3 were missing it, causing errors on forks every day.

## Testing Plan

- Verified that the added condition matches the existing pattern used in triage.yml, stale-bot.yml, and upload-adk-docs-to-vertex-ai-search.yml
- On forks, the job will be skipped (same behavior as the already-protected workflows)
- On google/adk-python, the workflows will continue to run as before since the condition evaluates to true

Co-authored-by: George Weale <gweale@google.com>
COPYBARA_INTEGRATE_REVIEW=#5391 from Wu-Jiayang:fix/workflow-fork-protection 6601a67
PiperOrigin-RevId: 931242443
@adk-bot

adk-bot commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

Thank you @Wu-Jiayang for your contribution! 🎉

Your changes have been successfully imported and merged via Copybara in commit 90bd38f.

Closing this PR as the changes are now in the main branch.

@adk-bot adk-bot added the merged [Status] This PR is merged label Jun 12, 2026
@adk-bot adk-bot closed this Jun 12, 2026
@GWeale GWeale self-assigned this Jun 15, 2026
FrigaZzz pushed a commit to FrigaZzz/adk-python that referenced this pull request Aug 11, 2026
Merge google#5391

## Summary

- Add `if: github.repository == 'google/adk-python'` guard to 3 workflows that lack this protection: v2-sync, issue-monitor, and copybara-pr-handler
- These workflows use secrets unavailable on forks (RELEASE_PAT, ADK_TRIAGE_AGENT, GOOGLE_API_KEY), causing daily failures on forks

## Context

Other scheduled/repo-specific workflows (triage.yml, stale-bot.yml, upload-adk-docs-to-vertex-ai-search.yml) already have this guard. These 3 were missing it, causing errors on forks every day.

## Testing Plan

- Verified that the added condition matches the existing pattern used in triage.yml, stale-bot.yml, and upload-adk-docs-to-vertex-ai-search.yml
- On forks, the job will be skipped (same behavior as the already-protected workflows)
- On google/adk-python, the workflows will continue to run as before since the condition evaluates to true

Co-authored-by: George Weale <gweale@google.com>
COPYBARA_INTEGRATE_REVIEW=google#5391 from Wu-Jiayang:fix/workflow-fork-protection 6601a67
PiperOrigin-RevId: 931242443
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged [Status] This PR is merged needs review [Status] The PR/issue is awaiting review from the maintainer tools [Component] This issue is related to tools

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants