Skip to content

Commit fb4f152

Browse files
committed
chore: read secrets from Akeyeless
1 parent 2cfc80a commit fb4f152

File tree

3 files changed

+42
-14
lines changed

3 files changed

+42
-14
lines changed

.github/workflows/cd.yml

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,28 @@ on:
1212
jobs:
1313
build:
1414
runs-on: ubuntu-latest
15+
environment: upload
16+
17+
permissions:
18+
id-token: write # Required by Akeyless
19+
contents: read
20+
packages: read
1521

1622
steps:
23+
- name: Import Secrets
24+
id: import-secrets
25+
uses: LanceMcCarthy/akeyless-action@v3
26+
with:
27+
access-id: ${{ secrets.GH_AKEYLESS_ACCESS_ID }}
28+
static-secrets: |
29+
{
30+
"/WebComponents/prod/tokens/GH_TOKEN": "GH_TOKEN",
31+
"/WebComponents/prod/tokens/PROGRESS_NPM_REGISTRY_TOKEN": "NPM_TOKEN"
32+
}
33+
export-secrets-to-environment: false
34+
1735
- name: Check out branch
18-
uses: actions/checkout@v2
36+
uses: actions/checkout@v3
1937
with:
2038
fetch-depth: 0 # Fetch all branches
2139

@@ -36,6 +54,5 @@ jobs:
3654
- name: Publish release
3755
run: npx ci-semantic-release
3856
env:
39-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
40-
GH_TOKEN: ${{ secrets.GH_TOKEN }}
41-
57+
NPM_TOKEN: ${{ steps.import-secrets.outputs.NPM_TOKEN }}
58+
GH_TOKEN: ${{ steps.import-secrets.outputs.GH_TOKEN }}

.github/workflows/ci.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,16 @@ jobs:
1212
build:
1313
runs-on: ubuntu-latest
1414

15-
steps:
16-
- name: Cancel previous runs
17-
uses: styfle/[email protected]
18-
with:
19-
access_token: ${{ github.token }}
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.ref }}
17+
cancel-in-progress: true
2018

19+
steps:
2120
- name: Check out repository
22-
uses: actions/checkout@v2
21+
uses: actions/checkout@v3
2322

2423
- name: Use Node.js
25-
uses: actions/setup-node@v1
24+
uses: actions/setup-node@v2
2625
with:
2726
node-version: '14'
2827

@@ -37,4 +36,3 @@ jobs:
3736

3837
- name: Run unit tests
3938
run: CHROME_BIN=`which chrome || which chromium-browser` ENV_BROWSER=Chrome_headless npm run test
40-

.github/workflows/publish.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,26 @@ jobs:
1010
build:
1111
runs-on: ubuntu-latest
1212

13+
permissions:
14+
id-token: write # Required by Akeyless
15+
contents: read
16+
packages: read
17+
1318
steps:
19+
- name: Import Secrets
20+
id: import-secrets
21+
uses: LanceMcCarthy/akeyless-action@v3
22+
with:
23+
access-id: ${{ secrets.GH_AKEYLESS_ACCESS_ID }}
24+
static-secrets: '{ "/WebComponents/prod/tokens/GH_TOKEN": "GH_TOKEN" }'
25+
export-secrets-to-environment: false
26+
1427
- name: Check out master
15-
uses: actions/checkout@v2
28+
uses: actions/checkout@v3
1629
with:
1730
ref: master
1831
fetch-depth: 0 # Fetch all branches
19-
token: ${{ secrets.GH_TOKEN }}
32+
token: ${{ steps.import-secrets.outputs.GH_TOKEN }}
2033

2134
- name: Use Node.js
2235
uses: actions/setup-node@v1

0 commit comments

Comments
 (0)