[GH-ISSUE #796] Issue: -P seems to be ignored #495

Closed
opened 2026-03-01 21:43:54 +03:00 by kerem · 8 comments
Owner

Originally created by @gdanov on GitHub (Sep 6, 2021).
Original GitHub issue: https://github.com/nektos/act/issues/796

how to reproduce:

  • on osx brew install act
  • run with -j that has runs-on: ubuntu-20.04
  • on first run act asks about the image. I choose "large"
  • act ignores my choice and seems to use the defaults it set in ~/.actrc (ubuntu-18.04=nektos/act-environments-ubuntu:18.04 )
  • I add my ubuntu-20 choice to ~/.actrc so that it looks like this -P ubuntu-18.04=nektos/act-environments-ubuntu:18.04 ubuntu-20.04=ghcr.io/catthehacker/ubuntu:full-20.04
  • re-run act but same result
  • I remove the ubuntu-18 target so that ~/.actrc looks like -P ubuntu-20.04=ghcr.io/catthehacker/ubuntu:full-20.04
  • act downloads the image I want this time
Originally created by @gdanov on GitHub (Sep 6, 2021). Original GitHub issue: https://github.com/nektos/act/issues/796 how to reproduce: - on osx `brew install act` - run with -j <some job> that has `runs-on: ubuntu-20.04` - on first run act asks about the image. I choose "large" - act ignores my choice and seems to use the defaults it set in ~/.actrc (ubuntu-18.04=nektos/act-environments-ubuntu:18.04 ) - I add my ubuntu-20 choice to ~/.actrc so that it looks like this `-P ubuntu-18.04=nektos/act-environments-ubuntu:18.04 ubuntu-20.04=ghcr.io/catthehacker/ubuntu:full-20.04` - re-run act but same result - I remove the ubuntu-18 target so that ~/.actrc looks like `-P ubuntu-20.04=ghcr.io/catthehacker/ubuntu:full-20.04` - act downloads the image I want this time
kerem 2026-03-01 21:43:54 +03:00
  • closed this issue
  • added the
    kind/bug
    label
Author
Owner

@catthehacker commented on GitHub (Sep 6, 2021):

correct syntax is

-P ubuntu-18.04=nektos/act-environments-ubuntu:18.04 -P ubuntu-20.04=ghcr.io/catthehacker/ubuntu:full-20.04
<!-- gh-comment-id:913664865 --> @catthehacker commented on GitHub (Sep 6, 2021): correct syntax is ``` -P ubuntu-18.04=nektos/act-environments-ubuntu:18.04 -P ubuntu-20.04=ghcr.io/catthehacker/ubuntu:full-20.04 ```
Author
Owner

@gdanov commented on GitHub (Sep 6, 2021):

it was completely ignored the fact that at start-up my entry is ignored and wrong environment is used.

<!-- gh-comment-id:913666462 --> @gdanov commented on GitHub (Sep 6, 2021): it was completely ignored the fact that at start-up my entry is ignored and wrong environment is used.
Author
Owner

@catthehacker commented on GitHub (Sep 6, 2021):

Nothing was ignored, latest act release doesn't include my images (https://github.com/nektos/act/pull/766) and only ubuntu-18.04 was available before that.

<!-- gh-comment-id:913667886 --> @catthehacker commented on GitHub (Sep 6, 2021): Nothing was ignored, latest `act` release doesn't include my images (https://github.com/nektos/act/pull/766) and only `ubuntu-18.04` was available before that.
Author
Owner

@gdanov commented on GitHub (Sep 6, 2021):

let me try again:

when I provide -P ubuntu-18.04=nektos/act-environments-ubuntu:18.04 -P ubuntu-20.04=ghcr.io/catthehacker/ubuntu:act-20.04 in the ~/.actrc file

and run a job that requires ubuntu-20 (regular is ok)

I see ImageOS:ubuntu20 in the logs

BUT the build fails with
::error::Unable to locate executable file: docker. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.

If I have only the ubuntu-20 -P setting then the job works.

<!-- gh-comment-id:913670287 --> @gdanov commented on GitHub (Sep 6, 2021): let me try again: when I provide `-P ubuntu-18.04=nektos/act-environments-ubuntu:18.04 -P ubuntu-20.04=ghcr.io/catthehacker/ubuntu:act-20.04` in the ~/.actrc file and run a job that requires ubuntu-20 (regular is ok) I see `ImageOS:ubuntu20` in the logs BUT the build fails with `::error::Unable to locate executable file: docker. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.` If I have only the ubuntu-20 -P setting then the job works.
Author
Owner

@catthehacker commented on GitHub (Sep 6, 2021):

No idea, but you could follow the issue template and then I might be able to find out.

<!-- gh-comment-id:913671752 --> @catthehacker commented on GitHub (Sep 6, 2021): No idea, but you could follow the issue template and then I might be able to find out.
Author
Owner

@catthehacker commented on GitHub (Sep 6, 2021):

.actrc is newline delimited so you need to have

-P ubuntu-18.04=nektos/act-environments-ubuntu:18.04
-P ubuntu-20.04=ghcr.io/catthehacker/ubuntu:act-20.04
<!-- gh-comment-id:913676501 --> @catthehacker commented on GitHub (Sep 6, 2021): `.actrc` is newline delimited so you need to have ``` -P ubuntu-18.04=nektos/act-environments-ubuntu:18.04 -P ubuntu-20.04=ghcr.io/catthehacker/ubuntu:act-20.04 ```
Author
Owner

@gdanov commented on GitHub (Sep 6, 2021):

Thanks. That works. So, basically it seems that

when no -P is provided for non-default platform required in action's run-on:

then act silently uses the default one?

<!-- gh-comment-id:913682765 --> @gdanov commented on GitHub (Sep 6, 2021): Thanks. That works. So, basically it seems that when **no** -P is provided for non-default platform required in action's `run-on:` then act silently uses the default one?
Author
Owner

@catthehacker commented on GitHub (Sep 6, 2021):

Yes, that's correct

<!-- gh-comment-id:913684932 --> @catthehacker commented on GitHub (Sep 6, 2021): Yes, that's correct
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/act#495
No description provided.