Skip to content

Commit f953fd6

Browse files
authored
Merge pull request #1 from Pay201/Pay201-patch-1
Create main.yml
2 parents afb19b4 + 6c49aac commit f953fd6

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

.github/workflows/main.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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:

0 commit comments

Comments
 (0)