Skip to content

[GitHub Actions] Fix our broken port_pr action after the upgrade to checkout@v7#12812

Merged
tdonohue merged 1 commit into
DSpace:mainfrom
tdonohue:update_port_pr_settings
Jul 17, 2026
Merged

[GitHub Actions] Fix our broken port_pr action after the upgrade to checkout@v7#12812
tdonohue merged 1 commit into
DSpace:mainfrom
tdonohue:update_port_pr_settings

Conversation

@tdonohue

@tdonohue tdonohue commented Jul 16, 2026

Copy link
Copy Markdown
Member

Description

As of checkout@v7, for security reasons the checkout action will always fail when run on the pull_request_target event.

See https://docs.github.com/en/actions/reference/security/securely-using-pull_request_target

However, we need to run the port_pr job on the pull_request_target event to allow it to create backported PRs. We also need to run the checkout command in order to checkout the code which is being backported.

Therefore, this small PR enables the allow-unsafe-pr-checkout option of the checkout job. 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:

  • Ensure this port_pr job will trigger if a port to... label exists on the PR.
    • This doesn't change behavior, as the job currently will run & do nothing if that label doesn't exist. But, this small change just ensures the job doesn't even run if the label doesn't exist.

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-angular repository.

Instructions for Reviewers

  • Verify you agree with the changed settings in this PR, especially the newly added allow-unsafe-pr-checkout option

… why. Also tweak the run statement to only trigger job if a "port to" label exists.
@tdonohue tdonohue added this to the 11.0 milestone Jul 16, 2026
@tdonohue tdonohue added the code task Code cleanup task label Jul 16, 2026
@tdonohue tdonohue added 1 APPROVAL pull request only requires a single approval to merge. port to dspace-8_x This PR needs to be ported to `dspace-8_x` branch for next bug-fix release port to dspace-9_x This PR needs to be ported to `dspace-9_x` branch for next bug-fix release port to dspace-10_x This PR needs to be ported to `dspace-10_x` branch for next bug-fix release labels Jul 16, 2026
@tdonohue tdonohue moved this to 🙋 Needs Reviewers Assigned in DSpace 11.0 Release Jul 16, 2026

@kshepherd kshepherd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@github-project-automation github-project-automation Bot moved this from 🙋 Needs Reviewers Assigned to 👍 Reviewer Approved in DSpace 11.0 Release Jul 17, 2026
@tdonohue
tdonohue merged commit e93727f into DSpace:main Jul 17, 2026
27 checks passed
@github-project-automation github-project-automation Bot moved this from 👍 Reviewer Approved to ✅ Done in DSpace 11.0 Release Jul 17, 2026
@dspace-bot

Copy link
Copy Markdown
Contributor

Backport failed for dspace-8_x, because it was unable to cherry-pick the commit(s).

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

@dspace-bot

Copy link
Copy Markdown
Contributor

Backport failed for dspace-9_x, because it was unable to cherry-pick the commit(s).

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

@dspace-bot

Copy link
Copy Markdown
Contributor

@tdonohue tdonohue removed port to dspace-8_x This PR needs to be ported to `dspace-8_x` branch for next bug-fix release port to dspace-9_x This PR needs to be ported to `dspace-9_x` branch for next bug-fix release port to dspace-10_x This PR needs to be ported to `dspace-10_x` branch for next bug-fix release labels Jul 17, 2026
@tdonohue
tdonohue deleted the update_port_pr_settings branch July 17, 2026 14:37
@tdonohue

Copy link
Copy Markdown
Member Author

Ported to dspace-angular in DSpace/dspace-angular#5967

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1 APPROVAL pull request only requires a single approval to merge. code task Code cleanup task

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

3 participants