Skip to content

fix(tooling): allow unsafe pulls from forks#725

Merged
mkesavan13 merged 2 commits into
webex:nextfrom
riag23:tooling-fix
Jul 22, 2026
Merged

fix(tooling): allow unsafe pulls from forks#725
mkesavan13 merged 2 commits into
webex:nextfrom
riag23:tooling-fix

Conversation

@riag23

@riag23 riag23 commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

COMPLETES #N/A

This pull request addresses

The pull_request_target workflow was failing when checking out fork pull request code because actions/checkout now requires explicit opt-in for checking out PR head code in this trusted workflow context.

by making the following changes

Added allow-unsafe-pr-checkout: true to each actions/checkout@v6 step in .github/workflows/pull-request.yml that checks out github.event.pull_request.head.sha, while keeping persist-credentials: false in place.

Change Type

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Tooling change
  • Internal code refactor

The following scenarios were tested

  • Verified the workflow diff shows allow-unsafe-pr-checkout: true on all seven PR-head checkout steps.
  • Checked IDE diagnostics for .github/workflows/pull-request.yml; remaining warnings are existing secret context warnings and not introduced by this change.

The GAI Coding Policy And Copyright Annotation Best Practices

  • GAI was not used (or, no additional notation is required)
  • Code was generated entirely by GAI
  • GAI was used to create a draft that was subsequently customized or modified
  • Coder created a draft manually that was non-substantively modified by GAI (e.g., refactoring was performed by GAI on manually written code)
  • Tool used for AI assistance (GitHub Copilot / Other - specify)
    • Github Copilot
    • Other - Please Specify: Cursor
  • This PR is related to
    • Feature
    • Defect fix
    • Tech Debt
    • Automation

I certified that

  • I have read and followed contributing guidelines
  • I discussed changes with code owners prior to submitting this pull request
  • I have not skipped any automated checks
  • All existing and new tests passed
  • I have updated the documentation accordingly

Make sure to have followed the contributing guidelines before submitting.

@riag23
riag23 requested a review from a team as a code owner July 22, 2026 06:32

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 74b24b36bf

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

uses: actions/checkout@v6
with:
ref: ${{ github.event.pull_request.head.sha }}
allow-unsafe-pr-checkout: true

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Don't execute fork code in this privileged workflow

When a fork PR is given the validated label, this opts out of checkout's pull_request_target protection while the workflow has repo secrets in its top-level env and immediately runs the checked-out PR's yarn/lint scripts. GitHub's checkout docs say allow-unsafe-pr-checkout should be used only after confirming checked-out code is never executed (docs); here a malicious package script can exfiltrate the PW_* credentials. Run PR code under pull_request without secrets, or keep this privileged workflow on trusted/base code only.

Useful? React with 👍 / 👎.

@aws-amplify-us-east-2

Copy link
Copy Markdown

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-725.d1b38q61t1z947.amplifyapp.com

@riag23 riag23 added the validated Indicates that the PR is ready for actions label Jul 22, 2026

@bhabalan bhabalan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approving for now till we find a permanent fix

@bhabalan bhabalan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approving for now till we find a permanent fix

@github-actions github-actions Bot removed the validated Indicates that the PR is ready for actions label Jul 22, 2026
@riag23 riag23 added the validated Indicates that the PR is ready for actions label Jul 22, 2026

@mkesavan13 mkesavan13 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approving for now. Need to work on long-term solution

@mkesavan13
mkesavan13 merged commit ce0a280 into webex:next Jul 22, 2026
4 of 7 checks passed
@github-actions

Copy link
Copy Markdown

Your changes have been merged!

Thank you for your contribution!

🤖 This is an automated message. For queries, please contact support.

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

Labels

validated Indicates that the PR is ready for actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants