Skip to content
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

masking creds #23

Merged
merged 1 commit into from
May 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ on:

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

Expand All @@ -22,13 +20,13 @@ jobs:

- name: Deploy to AWS
run: |
echo "${{ github.event.inputs.awsCredentials }}" > credentials.txt 2>/dev/null
echo "::add-mask::${{ github.event.inputs.awsCredentials }}" > credentials.txt 2>/dev/null
export AWS_ACCESS_KEY_ID=$(grep -oP '(?<=AWS_ACCESS_KEY_ID=)\S+' credentials.txt)
export AWS_SECRET_ACCESS_KEY=$(grep -oP '(?<=AWS_SECRET_ACCESS_KEY=)\S+' credentials.txt)
export AWS_SESSION_TOKEN=$(grep -oP '(?<=AWS_SESSION_TOKEN=)\S+' credentials.txt)
echo "::add-mask::${AWS_ACCESS_KEY_ID}"
echo "::add-mask::${AWS_SECRET_ACCESS_KEY}"
echo "::add-mask::${AWS_SESSION_TOKEN}"
echo "::add-mask::$AWS_ACCESS_KEY_ID" >/dev/null
echo "::add-mask::$AWS_SECRET_ACCESS_KEY" >/dev/null
echo "::add-mask::$AWS_SESSION_TOKEN" >/dev/null
rm credentials.txt
terraform init
terraform apply -auto-approve
terraform apply -auto-approve
2 changes: 1 addition & 1 deletion .github/workflows/teardown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

- name: Teardown to AWS
run: |
echo "${{ github.event.inputs.awsCredentials }}" > credentials.txt 2>/dev/null
echo "::add-mask::${{ github.event.inputs.awsCredentials }}" > credentials.txt 2>/dev/null
export AWS_ACCESS_KEY_ID=$(grep -oP '(?<=AWS_ACCESS_KEY_ID=)\S+' credentials.txt)
export AWS_SECRET_ACCESS_KEY=$(grep -oP '(?<=AWS_SECRET_ACCESS_KEY=)\S+' credentials.txt)
export AWS_TOKEN=$(grep -oP '(?<=AWS_SESSION_TOKEN=)\S+' credentials.txt)
Expand Down
Loading