-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from youyo/feature/github-actions
Add
- Loading branch information
Showing
3 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: 'AWS Assume role GitHub Actions' | ||
description: 'Runs awscredswrap via GitHub Actions.' | ||
author: 'youyo <1003ni2@gmail.com>' | ||
branding: | ||
icon: 'terminal' | ||
color: 'blue' | ||
inputs: | ||
duration_seconds: | ||
description: 'The duration, in seconds, of the role session. (default 3600)' | ||
default: 3600 | ||
role_arn: | ||
description: 'The arn of the role to assume.' | ||
required: true | ||
role_session_name: | ||
description: 'An identifier for the assumed role session.' | ||
default: 'awscredswrap@GitHubActions' | ||
runs: | ||
using: 'docker' | ||
image: 'github-actions/Dockerfile' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
FROM youyo/awscredswrap:latest | ||
|
||
LABEL maintainer "youyo <1003ni2@gmail.com>" | ||
|
||
COPY entrypoint.sh /entrypoint.sh | ||
|
||
ENTRYPOINT ["/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/sh | ||
|
||
eval $(/awscredswrap --role-arn ${INPUT_ROLE_ARN} --role-session-name ${INPUT_ROLE_SESSION_NAME} --duration-seconds ${INPUT_DURATION_SECONDS}) | ||
|
||
echo ::add-mask::${AWS_ACCESS_KEY_ID} | ||
echo ::add-mask::${AWS_SECRET_ACCESS_KEY} | ||
echo ::add-mask::${AWS_SESSION_TOKEN} | ||
echo ::add-mask::${AWS_DEFAULT_REGION} | ||
|
||
echo ::set-env name=AWS_ACCESS_KEY_ID::${AWS_ACCESS_KEY_ID} | ||
echo ::set-env name=AWS_SECRET_ACCESS_KEY::${AWS_SECRET_ACCESS_KEY} | ||
echo ::set-env name=AWS_SESSION_TOKEN::${AWS_SESSION_TOKEN} | ||
echo ::set-env name=AWS_DEFAULT_REGION::${AWS_DEFAULT_REGION} |