Skip to content

Commit

Permalink
masking1
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-ajaiswal authored Sep 10, 2024
1 parent ff02594 commit 5100c71
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
name: Fetch Secrets from AWS Secrets Manager


on:
workflow_dispatch:

Expand All @@ -25,19 +24,15 @@ jobs:
id: fetch-secret
run: |
secret_value=$(aws secretsmanager get-secret-value --secret-id ${{ secrets.SECRET_NAME }} --query SecretString --output text)
echo "::set-output name=secret_value::$secret_value"
echo "::add-mask::$secret_value"
echo "SECRET_VALUE=$secret_value" >> $GITHUB_ENV
- name: setup environment
- name: Set up Python environment
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name : Use the secret
run: |
echo "Using secret in the job: ${{ steps.fetch-secret.outputs.secret_value }}"
echo "::add-mask:: SECRETS=${{ steps.fetch-secret.outputs.secret_value }}" >> $GITHUB_ENV # Store the secret in an environment variable

- name: Run Python script with API secret
run: python3 github-api.py
env:
API_SECRET: ${{ env.SECRETS }}

API_SECRET: ${{ env.SECRET_VALUE }}

0 comments on commit 5100c71

Please sign in to comment.