[GH-ISSUE #2161] .actrc ignores command substitution #1032

Open
opened 2026-03-01 21:48:21 +03:00 by kerem · 3 comments
Owner

Originally created by @phoolish on GitHub (Jan 19, 2024).
Original GitHub issue: https://github.com/nektos/act/issues/2161

Act version

0.2.57

Feature description

The README.md documentation recommends using act -s GITHUB_TOKEN="$(gh auth token)" for setting your github token during runs, but adding the argument to your .actrc ignores the command substitution and results in $GITHUB_TOKEN being set to "$(gh auth token)".

It would be helpful if .actrc properly evaluated the commands, but I understand if that is a large undertaking and is better left to a wrapper script.

Originally created by @phoolish on GitHub (Jan 19, 2024). Original GitHub issue: https://github.com/nektos/act/issues/2161 ### Act version 0.2.57 ### Feature description The [README.md documentation](https://github.com/nektos/act#github_token) recommends using `act -s GITHUB_TOKEN="$(gh auth token)"` for setting your github token during runs, but adding the argument to your `.actrc` ignores the command substitution and results in `$GITHUB_TOKEN` being set to `"$(gh auth token)"`. It would be helpful if `.actrc` properly evaluated the commands, but I understand if that is a large undertaking and is better left to a wrapper script.
Author
Owner

@luckydonald commented on GitHub (Jan 29, 2024):

This would also allow for other commands like using Bitwarden-cli or something similar to fetch secrets.

<!-- gh-comment-id:1913779574 --> @luckydonald commented on GitHub (Jan 29, 2024): This would also allow for other commands like using Bitwarden-cli or something similar to fetch secrets.
Author
Owner

@chrisspiegl commented on GitHub (Jul 29, 2024):

I ran into the same issue and was confused until I found out that I basically have to create an alias for act which includes the act -s GITHUB_TOKEN="$(gh auth token)" stuff.

That makes it at least a bit easier to work with and not have to include it every time I use act.

I hope the .actrc can be improved like that? Or maybe some command we can set in .actrc that automatically does the gh auth token in the background?

<!-- gh-comment-id:2255409969 --> @chrisspiegl commented on GitHub (Jul 29, 2024): I ran into the same issue and was confused until I found out that I basically have to create an alias for `act` which includes the `act -s GITHUB_TOKEN="$(gh auth token)"` stuff. That makes it at least a bit easier to work with and not have to include it every time I use `act`. I hope the `.actrc` can be improved like that? Or maybe some command we can set in `.actrc` that automatically does the `gh auth token` in the background?
Author
Owner

@ravensorb commented on GitHub (Jan 23, 2025):

Would be good if it handled command subst and env variable expansion. This would simplify a LOT.

<!-- gh-comment-id:2608565038 --> @ravensorb commented on GitHub (Jan 23, 2025): Would be good if it handled command subst and env variable expansion. This would simplify a LOT.
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#1032
No description provided.