mirror of
https://github.com/nektos/act.git
synced 2026-04-26 09:25:54 +03:00
[GH-ISSUE #409] Use local aws credentials in local act run #287
Labels
No labels
area/action
area/cli
area/docs
area/image
area/runner
area/workflow
backlog
confirmed/not-planned
kind/bug
kind/discussion
kind/external
kind/feature-request
kind/question
meta/duplicate
meta/invalid
meta/need-more-info
meta/resolved
meta/wontfix
meta/workaround
needs-work
pull-request
review/not-planned
size/M
size/XL
size/XXL
stale
stale-exempt
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/act#287
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @aldegoeij on GitHub (Nov 6, 2020).
Original GitHub issue: https://github.com/nektos/act/issues/409
Is it somehow possible to read the credentials from my local
~/.aws/directory and use them in the workflow run?It is the same logic as used in e.g. docker by adding
-v $HOME/.aws:/root/.awsto docker run command. Processes in the docker container now use the local credentials as base credentials for role assume.This way within the workflow the base credentials are the base credentials of my local aws configuration. Currently I need to copy paste Access Key Id, Secret Access Key and Session Token into a
.secretsfile foractto pickup?Is there any way to pass e.g. custom docker commands?
@rahb3rt commented on GitHub (Nov 18, 2020):
I am sure you could pass them in via secrets function?
Something like
act -s AWS_SECRETE=$(cat ~/.aws/config)and so on would that not work? @aldegoeij@github-actions[bot] commented on GitHub (Jan 16, 2021):
Issue is stale and will be closed in 14 days unless there is new activity
@vcolanoKH commented on GitHub (Feb 11, 2022):
Finagling @rahb3rt's answer a bit I got this working with
Sources:
@rdettai commented on GitHub (Mar 16, 2022):
for reference, what i ended up doing:
calling command
act --env CREDS_FILE="$(shell cat ~/.aws/credentials | base64 -w 0)"new step
As you can see, I am encoding with base64 to avoid all escaping/newline issues.
@furkantektas commented on GitHub (May 2, 2024):
Alternative to @rdettai's solution, you can pass the credentials via
env-fileparameter like this:@chris-porter-trend commented on GitHub (Mar 11, 2025):
This worked very well for me. I find issues some issues using both
aws-actions/configure-aws-credentials@v4andaws-actions/amazon-ecr-login@v2. Usingrole-to-assumeon the credentials side did not work, then realized that theaws configure export-credentialswas using my default AWS SSO profile. Adding a profile arg solved my issue:This ensured the exported credentials were for the intended account and I was able to remove
role-to-assumeusage.