@@ -100,7 +100,7 @@ runs:
100100 exit 1
101101 shell : bash -eEuo pipefail {0}
102102 - name : Reset path if needed
103- run : |
103+ run : | # zizmor: ignore[github-env] PATH is not user-controlled
104104 # Reset path if needed
105105 # https://github.com/pypa/gh-action-pypi-publish/issues/112
106106 if [[ $PATH != *"/usr/bin"* ]]; then
@@ -111,25 +111,6 @@ runs:
111111 echo "\$PATH reset. \$PATH=$PATH"
112112 fi
113113 shell : bash
114- - name : Set repo and ref from which to run Docker container action
115- id : set-repo-and-ref
116- run : |
117- # Set repo and ref from which to run Docker container action
118- # to handle cases in which `github.action_` context is not set
119- # https://github.com/actions/runner/issues/2473
120- REF=${{ env.ACTION_REF || env.PR_REF || github.ref_name }}
121- REPO=${{ env.ACTION_REPO || env.PR_REPO || github.repository }}
122- REPO_ID=${{ env.PR_REPO_ID || github.repository_id }}
123- echo "ref=$REF" >>"$GITHUB_OUTPUT"
124- echo "repo=$REPO" >>"$GITHUB_OUTPUT"
125- echo "repo-id=$REPO_ID" >>"$GITHUB_OUTPUT"
126- shell : bash
127- env :
128- ACTION_REF : ${{ github.action_ref }}
129- ACTION_REPO : ${{ github.action_repository }}
130- PR_REF : ${{ github.event.pull_request.head.ref }}
131- PR_REPO : ${{ github.event.pull_request.head.repo.full_name }}
132- PR_REPO_ID : ${{ github.event.pull_request.base.repo.id }}
133114 - name : Discover pre-installed Python
134115 id : pre-installed-python
135116 run : |
@@ -151,9 +132,26 @@ runs:
151132 || steps.pre-installed-python.outputs.python-path
152133 }} '${{ github.action_path }}/create-docker-action.py'
153134 env :
154- REF : ${{ steps.set-repo-and-ref.outputs.ref }}
155- REPO : ${{ steps.set-repo-and-ref.outputs.repo }}
156- REPO_ID : ${{ steps.set-repo-and-ref.outputs.repo-id }}
135+ # Set repo and ref from which to run Docker container action
136+ # to handle cases in which `github.action_` context is not set
137+ # https://github.com/actions/runner/issues/2473
138+ REF : >-
139+ ${{
140+ github.action_ref
141+ || github.event.pull_request.head.ref
142+ || github.ref_name
143+ }}
144+ REPO : >-
145+ ${{
146+ github.action_repository
147+ || github.event.pull_request.head.repo.full_name
148+ || github.repository
149+ }}
150+ REPO_ID : >-
151+ ${{
152+ github.event.pull_request.base.repo.id
153+ || github.repository_id
154+ }}
157155 shell : bash
158156 - name : Run Docker container
159157 # The generated trampoline action must exist in the allowlisted
0 commit comments