From f1f3efcaed6c77c49d2c0b8401b73d4d89265a4c Mon Sep 17 00:00:00 2001 From: Sam Wray Date: Sat, 8 May 2021 16:45:28 +0100 Subject: [PATCH 1/2] fix: reverts github_token fix: removes credential line --- .github/workflows/release.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c4e5950c3..0b5242f18 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,7 +12,6 @@ jobs: uses: actions/checkout@v2 with: fetch-depth: 0 - persist-credentials: false # <--- this - name: Setup Node.js uses: actions/setup-node@v1 @@ -27,6 +26,6 @@ jobs: - name: Release env: - GH_TOKEN: ${{ secrets.GH_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: npx semantic-release From 3df1004cff9ee8e2d75e7925d65f8a7e0bb5bd3b Mon Sep 17 00:00:00 2001 From: Sam Wray Date: Sun, 9 May 2021 19:49:52 +0100 Subject: [PATCH 2/2] fix: fixes github workflows --- .github/workflows/build.yml | 6 +++--- .github/workflows/release.yml | 14 +++++++++++++- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e748c39e1..d383cd856 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,9 +2,9 @@ name: Build on: workflow_dispatch: - release: - types: - - published + push: + tags: + - '[0-9]+.[0-9]+.[0-9]+' env: ELECTRON_CACHE: $HOME/.cache/electron diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0b5242f18..7816af38e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,13 +6,25 @@ on: jobs: release: name: Release + + # specify the environment to select the right env variables + environment: build + runs-on: ubuntu-18.04 + + if: "!contains(github.event.head_commit.message, 'chore(release)')" + steps: - name: Checkout uses: actions/checkout@v2 with: fetch-depth: 0 + # required to use our own personal access token + # we need to use a custom PAT as other workflows + # aren't triggered using secrets.GITHUB_TOKEN + persist-credentials: false + - name: Setup Node.js uses: actions/setup-node@v1 with: @@ -26,6 +38,6 @@ jobs: - name: Release env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} run: npx semantic-release