Inconsistent value for `runner.temp` when running in a container
See original GitHub issueDescribe the bug
It appears https://github.com/actions/runner/pull/1762 only partly fixed the problem. Looking at a failed run https://github.com/github/codeql/actions/runs/4442367661/jobs/7798560621 the variable runner.temp
is expanded with two different values.
In the following workflow snippet:
runs-on: ubuntu-latest
container:
image: centos:centos7
steps:
- name: Download Ruby bundle
uses: actions/download-artifact@v3
with:
name: codeql-ruby-bundle
path: ${{ runner.temp }}
- name: Unzip Ruby bundle
shell: bash
run: unzip -q -d "${{ runner.temp }}/ruby-bundle" "${{ runner.temp }}/codeql-ruby-bundle.zip"
The use of path: ${{ github.temp }}
in the with:
clause of the download step was expanded correctly:
with:
name: codeql-ruby-bundle
path: /home/runner/work/_temp
but the variable was expanded wrongly in the run:
step.
unzip -q -d "/home/runner/work/_temp/ruby-bundle" "/home/runner/work/_temp/codeql-ruby-bundle.zip"
Expected behavior
All uses of the runner.temp
variable inside the steps
should be expanded to same value. The same for any of the other folder related variables.
Runner Version and Platform
Version of your runner? ‘2.303.0’
OS of the machine running the runner? Linux
What’s not working?
Job fails with a “file not found” error message.
Job Log Output
If applicable, include the relevant part of the job / step log output here. All sensitive information should already be masked out, but please double-check before pasting here.
23s
0s
Run actions/download-artifact@v3
/usr/bin/docker exec 738c06c08904026388[1](https://github.com/github/codeql/actions/runs/4442367661/jobs/7798560621#step:6:1)a29ebc5944bd1ae51256[8](https://github.com/github/codeql/actions/runs/4442367661/jobs/7798560621#step:6:9)[9](https://github.com/github/codeql/actions/runs/4442367661/jobs/7798560621#step:6:10)97cdb84589427445afc1e39 sh -c "cat /etc/*release | grep ^ID"
Starting download for codeql-ruby-bundle
Directory structure has been setup for the artifact
Total number of files that will be downloaded: 1
Artifact codeql-ruby-bundle was downloaded to /__w/_temp
Artifact download has finished successfully
0s
Run unzip -q -d "/home/runner/work/_temp/ruby-bundle" "/home/runner/work/_temp/codeql-ruby-bundle.zip"
unzip: cannot find or open /home/runner/work/_temp/codeql-ruby-bundle.zip, /home/runner/work/_temp/codeql-ruby-bundle.zip.zip or /home/runner/work/_temp/codeql-ruby-bundle.zip.ZIP.
Error: Process completed with exit code 9.
Issue Analytics
- State:
- Created 6 months ago
- Comments:8 (4 by maintainers)
Top GitHub Comments
Yes indeed, we already switched to
RUNNER_TEMP
which worked as expected.Thanks for helping me understand what it going on. In the end the expansion is not inconsistent. It’s just the way how action inputs are translated to environment variables that made it look like there was an inconsistency.
Exactly 😄 Envs are getting translated for sure I think you can leverage env instead of template to get the container path:
RUNNER_TEMP
for example That one will get translated for sure