-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FAQ: how to use this action with ACT #19
Comments
Looks like for some reason the run-command didn't get copied in the file. Let me investigate. |
@Erriez I think the issue is, that act runs in a container. Therefore it should mount a file from one container to another, which most likely doesn't work. The command failing is something like: Docker now tries to access the file Maybe @catthehacker can confirm this and has an idea how it would work with ACT? |
@kohlerdominik Thanks for your fast reply. I think you're right: I've created a test case in branch |
If you're interessted in contributing a solution, you could investigate whether act supports a shared directory between action container and host. If it does, we can adjust dockerRun.ts::8 to allow a variable, which then can point to that directory. |
You should not hardcode paths to |
It doesn't work probably because you are using container with |
Thanks @catthehacker! I can try to resolve the home dir from the environment variable. |
You can use |
I published a release which now imports the TEMP-path from the given environment variable. However, as I understood, this was not the root cause for this issue; in the unix runner it should've worked either way.
|
@kohlerdominik Now I understand the change: name: CI
on:
push:
branches:
- master
jobs:
build:
name: Build image
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- run: sudo chmod 0777 /var/run/docker.sock
- uses: kohlerdominik/docker-run-action@v1
with:
image: alpine:latest
run: |
echo "hello world"
uname -a $ act -P ubuntu-latest=ghcr.io/catthehacker/ubuntu:runner-latest
[CI/Build image] 🚀 Start image=ghcr.io/catthehacker/ubuntu:runner-latest
[CI/Build image] 🐳 docker run image=ghcr.io/catthehacker/ubuntu:runner-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[CI/Build image] 🐳 docker exec cmd=[mkdir -m 0777 -p /var/run/act] user=root
[CI/Build image] 🐳 docker cp src=/home/erwin/src/kohlerdominik_docker-run-action_issues_19/. dst=/home/erwin/src/kohlerdominik_docker-run-action_issues_19
[CI/Build image] 🐳 docker exec cmd=[mkdir -p /home/erwin/src/kohlerdominik_docker-run-action_issues_19] user=
[CI/Build image] ⭐ Run Checkout
[CI/Build image] ✅ Success - Checkout
[CI/Build image] ⭐ Run sudo chmod 0777 /var/run/docker.sock
[CI/Build image] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /home/erwin/src/kohlerdominik_docker-run-action_issues_19/workflow/1] user=
[CI/Build image] ✅ Success - sudo chmod 0777 /var/run/docker.sock
[CI/Build image] ⭐ Run kohlerdominik/docker-run-action@v1
INFO[0000] ☁ git clone 'https://github.com/kohlerdominik/docker-run-action' # ref=v1
[CI/Build image] 🐳 docker cp src=/home/erwin/.cache/act/kohlerdominik-docker-run-action@v1/ dst=/var/run/act/actions/kohlerdominik-docker-run-action@v1/
[CI/Build image] 🐳 docker exec cmd=[mkdir -p /var/run/act/actions/kohlerdominik-docker-run-action@v1/] user=
[CI/Build image] 🐳 docker exec cmd=[node /var/run/act/actions/kohlerdominik-docker-run-action@v1/dist/index.js] user=
|
| These instructions are passed to the container:
| ----- START OF FILE -----
| echo "hello world"
| uname -a
| ----- END OF FILE -----
| [command]/usr/bin/docker run --volume=/home/runner/work/_temp/efa60418-7a39-4f28-9c5f-01aee88f6bac.sh:/tmp/efa60418-7a39-4f28-9c5f-01aee88f6bac.sh alpine:latest sh -e /tmp/efa60418-7a39-4f28-9c5f-01aee88f6bac.sh
[CI/Build image] ✅ Success - kohlerdominik/docker-run-action@v1 Option Thanks! |
Running with act displays:
Any idea?
The text was updated successfully, but these errors were encountered: