Skip to content

fix(ci): skip autolabeler in PR from forks#1612

Merged
viccuad merged 1 commit intokubewarden:mainfrom
jvanz:fix-autolabeler-skip-fork-prs
Mar 27, 2026
Merged

fix(ci): skip autolabeler in PR from forks#1612
viccuad merged 1 commit intokubewarden:mainfrom
jvanz:fix-autolabeler-skip-fork-prs

Conversation

@jvanz
Copy link
Copy Markdown
Member

@jvanz jvanz commented Mar 26, 2026

Description

Following the recommendation from the SUSE security team, the pull_request_target triggers from all our CI files have been removed. However, this trigger is required to allow the autolabeler action tagging PRs from forks. It's not possible to use pull_request only because Github by default set all the permissions to read-only for this trigger. Ignoring what it is defined in the CI file.

Because of that, this PR updates the autolabeler CI workflow to skip the tagging when the PR came from a fork.

@jvanz jvanz self-assigned this Mar 26, 2026
@jvanz jvanz requested a review from a team as a code owner March 26, 2026 20:53
Copilot AI review requested due to automatic review settings March 26, 2026 20:53
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

Updates the Autolabeler GitHub Actions workflow to avoid attempting to label pull requests originating from forks (where the GITHUB_TOKEN is read-only), aligning with the removal of pull_request_target triggers.

Changes:

  • Add workflow-level permissions: contents: read.
  • Skip the autolabeler job for fork-based pull requests using a job-level if condition.

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

Comment thread .github/workflows/autolabeler.yml
@jvanz jvanz force-pushed the fix-autolabeler-skip-fork-prs branch from dad27f1 to baba082 Compare March 26, 2026 20:57
@jvanz jvanz requested a review from Copilot March 26, 2026 20:58
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 1 out of 1 changed files in this pull request and generated no new comments.


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

Following the reconmendation from the SUSE security team, the
`pull_request_target` triggers from all our CI files have been removed.
However, this trigger is required to allow the autolabeler action
tagging PRs from forks. It's not possible to use `pull_request` only
because Github by default set all the permissions to read-only for this
trigger. Ignoring what it is defined in the CI file.

Because of that, this commit updates the autolabeler CI workflow to skip
the tagging when the PR came from a fork.

Signed-off-by: José Guilherme Vanz <jguilhermevanz@suse.com>
@jvanz jvanz force-pushed the fix-autolabeler-skip-fork-prs branch from baba082 to 7e02c89 Compare March 26, 2026 21:03
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.46%. Comparing base (5e3e32a) to head (7e02c89).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1612      +/-   ##
==========================================
+ Coverage   80.42%   80.46%   +0.03%     
==========================================
  Files         127      127              
  Lines       16411    16411              
==========================================
+ Hits        13199    13205       +6     
+ Misses       3212     3206       -6     
Flag Coverage Δ
rust-tests 80.46% <ø> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@viccuad viccuad merged commit 300ffd9 into kubewarden:main Mar 27, 2026
29 checks passed
@github-project-automation github-project-automation Bot moved this from Pending review to Done in Kubewarden Admission Controller Mar 27, 2026
@jvanz jvanz deleted the fix-autolabeler-skip-fork-prs branch March 27, 2026 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

3 participants