diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index d97eb3c..0d50b96 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -12,10 +12,28 @@ on: jobs: build: runs-on: ubuntu-latest + environment: upload + + permissions: + id-token: write # Required by Akeyless + contents: read + packages: read steps: + - name: Import Secrets + id: import-secrets + uses: LanceMcCarthy/akeyless-action@v3 + with: + access-id: ${{ secrets.GH_AKEYLESS_ACCESS_ID }} + static-secrets: | + { + "/WebComponents/prod/tokens/GH_TOKEN": "GH_TOKEN", + "/WebComponents/prod/tokens/PROGRESS_NPM_REGISTRY_TOKEN": "NPM_TOKEN" + } + export-secrets-to-environment: false + - name: Check out branch - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 # Fetch all branches @@ -36,6 +54,5 @@ jobs: - name: Publish release run: npx ci-semantic-release env: - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - GH_TOKEN: ${{ secrets.GH_TOKEN }} - + NPM_TOKEN: ${{ steps.import-secrets.outputs.NPM_TOKEN }} + GH_TOKEN: ${{ steps.import-secrets.outputs.GH_TOKEN }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8891054..6d232ab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,17 +12,16 @@ jobs: build: runs-on: ubuntu-latest - steps: - - name: Cancel previous runs - uses: styfle/cancel-workflow-action@0.8.0 - with: - access_token: ${{ github.token }} + concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + steps: - name: Check out repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Use Node.js - uses: actions/setup-node@v1 + uses: actions/setup-node@v2 with: node-version: '14' @@ -37,4 +36,3 @@ jobs: - name: Run unit tests run: CHROME_BIN=`which chrome || which chromium-browser` ENV_BROWSER=Chrome_headless npm run test - diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e77e97d..967f125 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -10,13 +10,26 @@ jobs: build: runs-on: ubuntu-latest + permissions: + id-token: write # Required by Akeyless + contents: read + packages: read + steps: + - name: Import Secrets + id: import-secrets + uses: LanceMcCarthy/akeyless-action@v3 + with: + access-id: ${{ secrets.GH_AKEYLESS_ACCESS_ID }} + static-secrets: '{ "/WebComponents/prod/tokens/GH_TOKEN": "GH_TOKEN" }' + export-secrets-to-environment: false + - name: Check out master - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: ref: master fetch-depth: 0 # Fetch all branches - token: ${{ secrets.GH_TOKEN }} + token: ${{ steps.import-secrets.outputs.GH_TOKEN }} - name: Use Node.js uses: actions/setup-node@v1