github.action_repository
and github.action_ref
are empty in run
for composite actions
#49245
-
Select Topic AreaBug Body
For each of the following links, expand:
... and examine the
The expected results is that For my reference: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Described in another way Using it in the The change between these commits triggered an actions/runner bug E.g. this would work, otherwise wait for GitHub Support to fix actions/runner. - name: shim-path
shell: bash
run: |
THIS_ACTION_PATH=$(perl -pe 's#/\./#/#g; s#//+#/#g; s#/$##g' <<< "$RAW_ACTION_PATH")
(
echo "THIS_ACTION_PATH=$THIS_ACTION_PATH"
echo "PATH=$THIS_ACTION_PATH/wrappers:$PATH"
echo "TASK=${{ inputs.custom_task || inputs.task }}"
echo "DO_CHECKOUT=${{ inputs.checkout && inputs.checkout != 'false' && !(inputs.custom_task || inputs.task) }}"
echo "FETCH_DEPTH=${{ !contains(inputs.check_commit_messages || inputs.check-commit-messages, 'commits') && '1' || '0' }}"
echo "USE_SARIF=${{ inputs.use_sarif || inputs.use-sarif }}"
echo "ALTERNATE_ENGINE=${{ (inputs.alternate_engine || inputs.alternate-engine) || '' }}"
echo "GH_ACTION_REPOSITORY=$GH_ACTION_REPOSITORY"
echo "GH_ACTION_REF=$GH_ACTION_REF"
) >> "$GITHUB_ENV"
env:
GH_ACTION_REPOSITORY: ${{ github.action_repository || github.repository }}
GH_ACTION_REF: ${{ github.action_ref || github.ref_name }}
RAW_ACTION_PATH: ${{ github.action_path }} # Your action had a script injection problem and container path translation were broken due to another bug of actions/runner |
Beta Was this translation helpful? Give feedback.
Described in another way
github.action_repository
andgithub.action_ref
are empty (broken) in expressions within therun
step script definition of a composite action.Using it in the
env
field of a run step will behave correctly.The change between these commits triggered an actions/runner bug
https://github.com/check-spelling/check-spelling/compare/2bb4ea78df51ab5ded5612c08586e6ed59d1f032..50ca43769650975d2dee92e29fa9cbbe30d0247b#diff-1243c5424efaaa19bd8e813c5e6f6da46316e63761421b3e5f5c8ced9a36e6b6R472
E.g. this would work, otherwise wait for GitHub Support to fix actions/runner.