From 27f102734246c56d35396acc4defe1f96ab33fa7 Mon Sep 17 00:00:00 2001 From: Adriel Perkins Date: Mon, 20 Jun 2022 18:28:26 -0400 Subject: [PATCH] fix(ci): set goreleaser and sem release to use custom token To get the Go Releaser workflow triggered on commit push, a custom token needs to be used instead of the GITHUB_TOKEN. This is due to the API and how it triggers workflows based on events --- .github/workflows/gorelease.yaml | 2 +- .github/workflows/main.yaml | 22 ---------------------- .github/workflows/semrelease.yaml | 9 +++++++-- .github/workflows/test-check-go.yaml | 2 ++ 4 files changed, 10 insertions(+), 25 deletions(-) delete mode 100644 .github/workflows/main.yaml diff --git a/.github/workflows/gorelease.yaml b/.github/workflows/gorelease.yaml index 693b916d..39be80ac 100644 --- a/.github/workflows/gorelease.yaml +++ b/.github/workflows/gorelease.yaml @@ -36,4 +36,4 @@ jobs: version: latest args: release --rm-dist env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.SCHEMACHECK_RELEASE_TOKEN }} diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml deleted file mode 100644 index 425ade26..00000000 --- a/.github/workflows/main.yaml +++ /dev/null @@ -1,22 +0,0 @@ -# This is the workflow for the main release branch. - -name: Main Build, Test, and Publish - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -jobs: - - test-check-go: - uses: ./.github/workflows/test-check-go.yaml - - semrelease: - uses: ./.github/workflows/semrelease.yaml - needs: test-check-go - if: - contains(' - refs/heads/main - ', github.ref) diff --git a/.github/workflows/semrelease.yaml b/.github/workflows/semrelease.yaml index 5214d89a..cb1a9fb7 100644 --- a/.github/workflows/semrelease.yaml +++ b/.github/workflows/semrelease.yaml @@ -3,14 +3,19 @@ name: Semantic Release on: - workflow_call: + push: + branches: [ main ] jobs: + test-check-go: + uses: ./.github/workflows/test-check-go.yaml + semrelease: name: Sem Release runs-on: ubuntu-latest + needs: test-check-go steps: - name: Checkout source @@ -18,5 +23,5 @@ jobs: - uses: go-semantic-release/action@v1 with: - github-token: ${{ secrets.GITHUB_TOKEN }} + github-token: ${{ secrets.SCHEMACHECK_RELEASE_TOKEN }} changelog-generator-opt: "emojis=true" diff --git a/.github/workflows/test-check-go.yaml b/.github/workflows/test-check-go.yaml index 0315b323..5c92696e 100644 --- a/.github/workflows/test-check-go.yaml +++ b/.github/workflows/test-check-go.yaml @@ -3,6 +3,8 @@ name: Make Test and Checks on: + pull_request: + branches: [ main ] workflow_call: jobs: