Skip to content

Secrets to forked PRs #837

Answered by peterwoodworth
disa6302 asked this question in Q&A
Sep 8, 2023 · 3 comments · 4 replies
Discussion options

You must be logged in to vote

No worries for asking questions @disa6302,

I didn't directly answer how you can use pull_request_target because I don't want to come across like I'm recommending this unless you know exactly what you're doing. The article explains how you can use pull_request_target to run the submitter code while having access to secrets in your repository. What you need to do is check out the pull request head, and then you can do whatever you'd like

# INSECURE. Provided as an example only.
on:
  pull_request_target

jobs:
  build:
    name: Build and test
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
      with:
        ref: ${{ github.event.pull_request.head.sha }}

There are o…

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@peterwoodworth
Comment options

Answer selected by disa6302
@disa6302
Comment options

@kellertk
Comment options

@disa6302
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants