mirror of
https://github.com/pypa/gh-action-pypi-publish.git
synced 2024-11-22 08:31:08 -05:00
Checkout github.head_ref
and repo for PRs
https://github.com/actions/checkout/issues/27#issuecomment-535897113 https://github.com/actions/checkout/issues/1108
This commit is contained in:
parent
5ded5310e7
commit
a869dd36b2
1 changed files with 4 additions and 2 deletions
|
@ -111,14 +111,16 @@ runs:
|
||||||
# Set repo and ref from which to run Docker container action
|
# Set repo and ref from which to run Docker container action
|
||||||
# to handle cases in which `github.action_` context is not set
|
# to handle cases in which `github.action_` context is not set
|
||||||
# https://github.com/actions/runner/issues/2473
|
# https://github.com/actions/runner/issues/2473
|
||||||
REF=${{ env.ACTION_REF || github.ref_name }}
|
REF=${{ env.ACTION_REF || env.PR_REF || github.ref_name }}
|
||||||
REPO=${{ env.ACTION_REPO || github.repository }}
|
REPO=${{ env.ACTION_REPO || env.PR_REPO || github.repository }}
|
||||||
echo "ref=$REF" >>"$GITHUB_OUTPUT"
|
echo "ref=$REF" >>"$GITHUB_OUTPUT"
|
||||||
echo "repo=$REPO" >>"$GITHUB_OUTPUT"
|
echo "repo=$REPO" >>"$GITHUB_OUTPUT"
|
||||||
shell: bash
|
shell: bash
|
||||||
env:
|
env:
|
||||||
ACTION_REF: ${{ github.action_ref }}
|
ACTION_REF: ${{ github.action_ref }}
|
||||||
ACTION_REPO: ${{ github.action_repository }}
|
ACTION_REPO: ${{ github.action_repository }}
|
||||||
|
PR_REF: ${{ github.event.pull_request.head.ref }}
|
||||||
|
PR_REPO: ${{ github.event.pull_request.head.repo.full_name }}
|
||||||
- name: Check out action repo
|
- name: Check out action repo
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
|
|
Loading…
Reference in a new issue