File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ on : push
2+
3+ jobs :
4+ secret-generator :
5+ runs-on : ubuntu-latest
6+ outputs :
7+ handle : ${{ steps.generate-secret.outputs.handle }}
8+ steps :
9+ - uses : some/secret-store@27b31702a0e7fc50959f5ad993c78deac1bdfc29
10+ with :
11+ credentials : ${{ secrets.SECRET_STORE_CREDENTIALS }}
12+ instance : ${{ secrets.SECRET_STORE_INSTANCE }}
13+ - name : generate secret
14+ id : generate-secret
15+ shell : bash
16+ run : |
17+ GENERATED_SECRET=$((RANDOM))
18+ echo "::add-mask::$GENERATED_SECRET"
19+ SECRET_HANDLE=$(secret-store store-secret "$GENERATED_SECRET")
20+ echo "handle=$SECRET_HANDLE" >> "$GITHUB_OUTPUT"
21+ secret-consumer :
22+ runs-on : macos-latest
23+ needs : secret-generator
24+ steps :
25+ - uses : some/secret-store@27b31702a0e7fc50959f5ad993c78deac1bdfc29
26+ with :
27+ credentials : ${{ secrets.SECRET_STORE_CREDENTIALS }}
28+ instance : ${{ secrets.SECRET_STORE_INSTANCE }}
29+ - name : use secret
30+ shell : bash
31+ run : |
32+ SECRET_HANDLE="${{ needs.secret-generator.outputs.handle }}"
33+ RETRIEVED_SECRET=$(secret-store retrieve-secret "$SECRET_HANDLE")
34+ echo "::add-mask::$RETRIEVED_SECRET"
35+ echo "We retrieved our masked secret: $RETRIEVED_SECRET"
36+ concurrency :
You can’t perform that action at this time.
0 commit comments