Skip to content

Make backport/pr-filepath-check/auto_assign_prs reusable across velero-io repos - #10281

Open
kaovilai wants to merge 2 commits into
velero-io:mainfrom
kaovilai:centralize-reusable-workflows
Open

Make backport/pr-filepath-check/auto_assign_prs reusable across velero-io repos#10281
kaovilai wants to merge 2 commits into
velero-io:mainfrom
kaovilai:centralize-reusable-workflows

Conversation

@kaovilai

@kaovilai kaovilai commented Aug 14, 2026

Copy link
Copy Markdown
Member

Thank you for contributing to Velero!

Please add a summary of your change

Makes backport.yml, pr-filepath-check.yml, and auto_assign_prs.yml callable as reusable workflows (uses: velero-io/velero/.github/workflows/<file>@main) so velero-plugin-for-aws/-gcp/-microsoft-azure can call them instead of maintaining drifted local copies. This is the same pattern already used for get-go-version.yaml, which had already drifted (different actions/checkout pins per repo).

Changes:

  • Add workflow_call: as a trigger to each of the 3 workflows.
  • Drop their github.repository == 'velero-io/velero' guards. This is not a security tradeoff — GITHUB_TOKEN in a reusable-workflow call is scoped to the calling repo only, so a fork calling this workflow can never touch velero-io/velero itself. The comment-trigger path on backport.yml is still gated by author_association: OWNER/MEMBER/COLLABORATOR.
  • Added code comments documenting the reusable-workflow usage and a known blocker (see below).

Known blocker (pre-existing, tracked separately): backport still won't actually create PRs until "Allow GitHub Actions to create and approve pull requests" is enabled under Settings > Actions > General — currently unchecked/org-locked. Tracked in #9603. This needs to be enabled on this repo and on each plugin repo calling it (the gate is evaluated in the caller's context).

Companion PRs on the plugin repos — blocked on this PR merging first (they call @main on this repo, so nothing executes until this lands):

Does your change fix a particular issue?

Related to #9603 (does not fully fix it — the repo Actions setting still needs an org owner to enable it)

Please indicate you've done the following:

  • Accepted the DCO (commit is signed off)
  • Created a changelog file (make new-changelog) or comment /kind changelog-not-required on this PR. — commented /kind changelog-not-required; this is CI/infra-only, no user-facing behavior change.
  • Updated the corresponding documentation in site/content/docs/main. — N/A, no user-facing docs affected (GitHub Actions internals only).

Note

Responses generated with Claude

…o-io repos

Add workflow_call as a trigger to backport.yml, pr-filepath-check.yml, and
auto_assign_prs.yml, and drop their github.repository == 'velero-io/velero'
guards so velero-plugin-for-aws/gcp/microsoft-azure can call them via `uses:
velero-io/velero/.github/workflows/<file>@main` instead of maintaining drifted
local copies (e.g. get-go-version.yaml already drifted to different
actions/checkout pins across repos).

The guard removal isn't a security tradeoff: GITHUB_TOKEN in a reusable
workflow call is scoped to the calling repo only, so a fork calling this
workflow can never touch velero-io/velero itself. The existing
author_association: OWNER/MEMBER/COLLABORATOR check on the comment-trigger
path already self-limits that case.

Note: backport still won't function until "Allow GitHub Actions to create
and approve pull requests" is enabled under repo Settings > Actions (tracked
in velero-io#9603) -- on this repo AND on each calling repo, since that gate is
evaluated in the caller's context.

Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com>
@kaovilai
kaovilai requested a review from a team as a code owner August 14, 2026 20:18
@netlify

netlify Bot commented Aug 14, 2026

Copy link
Copy Markdown

Deploy Preview for velero canceled.

Name Link
🔨 Latest commit 6b3bc76
🔍 Latest deploy log https://app.netlify.com/projects/velero/deploys/6a7f9cf37213d90008d6ca49

@github-actions github-actions Bot added the kind/changelog-not-required PR does not require a user changelog. Often for docs, website, or build changes label Aug 14, 2026
@codecov

codecov Bot commented Aug 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@kaovilai

Copy link
Copy Markdown
Member Author

/kind changelog-not-required

Note

Responses generated with Claude

Documentation-only fix from a CodeRabbit review pass:
- The auto_assign_prs.yml comment claimed a checkout step resolves config to
  the calling repo; there is no checkout step in this workflow at all --
  kentaro-m/auto-assign-action fetches .github/auto-assignees.yml via the
  GitHub API using the calling repo's context instead.
- Both auto_assign_prs.yml and backport.yml now explicitly document which
  permissions scopes a caller must grant (a caller's own job-level
  permissions cap what this called workflow's jobs can request, regardless
  of what's declared here), and backport.yml documents the exact trigger
  event/type contract callers must use.

No behavior change.

Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/changelog-not-required PR does not require a user changelog. Often for docs, website, or build changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant