[GitHub Actions] Fix our broken port_pr action after the upgrade to checkout@v7#12812
Merged
Merged
Conversation
… why. Also tweak the run statement to only trigger job if a "port to" label exists.
kshepherd
approved these changes
Jul 17, 2026
kshepherd
left a comment
Member
There was a problem hiding this comment.
i am +1 with the acknowledgement that in the event of a problem sneaking into a PR that is approved and merged to main by one of us, we would have to repeat any rollback or mitigation on the 2-3 supported version branches that we reference in our "port to" labels.
Contributor
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin dspace-8_x
git worktree add -d .worktree/backport-12812-to-dspace-8_x origin/dspace-8_x
cd .worktree/backport-12812-to-dspace-8_x
git switch --create backport-12812-to-dspace-8_x
git cherry-pick -x 8e30c93c663936b8a28c8fa55fd3fe672dad1e26 |
Contributor
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin dspace-9_x
git worktree add -d .worktree/backport-12812-to-dspace-9_x origin/dspace-9_x
cd .worktree/backport-12812-to-dspace-9_x
git switch --create backport-12812-to-dspace-9_x
git cherry-pick -x 8e30c93c663936b8a28c8fa55fd3fe672dad1e26 |
Contributor
|
Successfully created backport PR for |
Member
Author
|
Ported to |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
As of
checkout@v7, for security reasons thecheckoutaction will always fail when run on thepull_request_targetevent.See https://docs.github.com/en/actions/reference/security/securely-using-pull_request_target
However, we need to run the
port_prjob on thepull_request_targetevent to allow it to create backported PRs. We also need to run thecheckoutcommand in order to checkout the code which is being backported.Therefore, this small PR enables the
allow-unsafe-pr-checkoutoption of thecheckoutjob. While this is bypassing security protections, in this scenario I feel we are safe because this job ONLY triggers during PR merger, and we ONLY merge PRs which are tested, reviewed and trusted (and scanned by CodeQL for security).Therefore, it should not be possible for someone to add code in a PR which can result in an attack on the DSpace codebase. Those attacks should be found by human reviewers, human testers or CodeQL before merger would occur.
This PR also includes a very tiny improvement:
port_prjob will trigger if aport to...label exists on the PR.NOTE: This PR will need to be backported to all active branches to ensure the same settings exist for PRs on all branches. It also must be ported to the
DSpace/dspace-angularrepository.Instructions for Reviewers
allow-unsafe-pr-checkoutoption