Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add workflow to restrict direct PRs to release branches #8240

Merged
merged 1 commit into from
Jan 14, 2025

Conversation

knqyf263
Copy link
Collaborator

@knqyf263 knqyf263 commented Jan 13, 2025

Description

Added workflow to prevent direct PRs to release branches (release/v*)

  • Fails if PR is created by non-aqua-bot user
  • Includes documentation link about the backporting process in error message

Tests

I confirmed this workflow correctly failed PRs from other than aqua-bot, but I didn't have a token of aqua-bot. I didn't have an idea to test it.
knqyf263#68

Checklist

  • I've read the guidelines for contributing to this repository.
  • I've followed the conventions in the PR title.
  • I've added tests that prove my fix is effective or that my feature works.
  • I've updated the documentation with the relevant information (if needed).
  • I've added usage information (if the PR introduces new options)
  • I've included a before and after example to the description (if the PR is a user interface change).

@knqyf263 knqyf263 self-assigned this Jan 13, 2025
@knqyf263 knqyf263 force-pushed the ci/check_backport_pr branch from 3009061 to 89308fc Compare January 13, 2025 15:47
@knqyf263 knqyf263 changed the title ci(backport): add workflow to restrict direct PRs to release branches ci: add workflow to restrict direct PRs to release branches Jan 13, 2025
@knqyf263 knqyf263 marked this pull request as ready for review January 14, 2025 02:48
@knqyf263 knqyf263 requested a review from DmitriyLewen January 14, 2025 02:49
@knqyf263
Copy link
Collaborator Author

@DmitriyLewen Please let me know if you have an idea how to test it in the fork repository.

@DmitriyLewen
Copy link
Contributor

DmitriyLewen commented Jan 14, 2025

@knqyf263 test run for aqua-bot user - https://github.com/aquasecurity/trivy-test/actions/runs/12761782228/job/35569284451?pr=22

But I found one problem - the release/v* branch must contain this workflow to start.
So perhaps we will want to create backport for this PR before v0.58.2.

@knqyf263
Copy link
Collaborator Author

I totally forgot about trivy-test 😨 Thanks for testing!

BTW, Itay found this setting in the branch protection.
CleanShot 2025-01-14 at 11 55 37

But I didn't find the equivalent in the rulesets.

@knqyf263
Copy link
Collaborator Author

So perhaps we will want to create backport for this PR before v0.58.2.

I already kicked the release since some users are waiting for v0.58.2. We can test this workflow next time.

@DmitriyLewen
Copy link
Contributor

I already kicked the release since some users are waiting for v0.58.2. We can test this workflow next time.

I suggest merging this PR anyway.
if we need to - we will move this PR to release/v0.58.
release/v0.59 will contain this fix anyway.

@knqyf263 knqyf263 added this pull request to the merge queue Jan 14, 2025
Merged via the queue into aquasecurity:main with commit 011012a Jan 14, 2025
13 of 14 checks passed
@knqyf263 knqyf263 deleted the ci/check_backport_pr branch January 14, 2025 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants