fix(ci): Restrict GitHub Actions to main/v1 branches and main repository
Update workflows to ensure they only run on the main repository (google/adk-python) and target main or v1 branches where applicable. This prevents workflows from running on forks and restricts merge blocking to main branch. Co-authored-by: Shangjie Chen <deanchen@google.com> PiperOrigin-RevId: 940031708
This commit is contained in:
committed by
Copybara-Service
parent
c961af9228
commit
8c4173ee5c
@@ -37,6 +37,7 @@ on:
|
||||
|
||||
jobs:
|
||||
analyze-new-release-for-adk-docs-updates:
|
||||
if: github.repository == 'google/adk-python'
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
@@ -16,10 +16,12 @@ name: Do Not Merge on GitHub
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [main]
|
||||
types: [opened, reopened, synchronize]
|
||||
|
||||
jobs:
|
||||
block-merge:
|
||||
if: github.repository == 'google/adk-python'
|
||||
name: maintainers will submit via Copybara
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
||||
@@ -26,8 +26,10 @@ permissions:
|
||||
jobs:
|
||||
agent-answer-questions:
|
||||
if: >-
|
||||
github.repository == 'google/adk-python' && (
|
||||
(github.event_name == 'discussion' && github.event.discussion.category.name == 'Q&A') ||
|
||||
(github.event_name == 'discussion_comment' && contains(github.event.comment.body, '@adk-bot') && github.event.sender.login != 'adk-bot')
|
||||
)
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
|
||||
@@ -34,6 +34,7 @@ on:
|
||||
|
||||
jobs:
|
||||
cherry-pick:
|
||||
if: github.repository == 'google/adk-python'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Determine Branch Configurations
|
||||
|
||||
@@ -47,6 +47,7 @@ permissions:
|
||||
|
||||
jobs:
|
||||
cut-or-regenerate:
|
||||
if: github.repository == 'google/adk-python'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Determine Branch Configurations
|
||||
|
||||
@@ -29,7 +29,7 @@ permissions:
|
||||
|
||||
jobs:
|
||||
finalize:
|
||||
if: github.event.pull_request.merged == true
|
||||
if: github.event.pull_request.merged == true && github.repository == 'google/adk-python'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check for release-please PR
|
||||
|
||||
@@ -26,6 +26,7 @@ permissions:
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
if: github.repository == 'google/adk-python'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Validate branch
|
||||
|
||||
@@ -28,6 +28,7 @@ on:
|
||||
|
||||
jobs:
|
||||
update-frontend:
|
||||
if: github.repository == 'google/adk-python'
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
Reference in New Issue
Block a user