diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 9ed0c981..b34fd090 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -5,29 +5,22 @@ on: branches: [main] jobs: - check-release: + is-release: # release merge commits come from GitHub user if: github.event.head_commit.committer.name == 'GitHub' outputs: - IS_RELEASE: ${{ steps.check-release.outputs.IS_RELEASE }} + IS_RELEASE: ${{ steps.is-release.outputs.IS_RELEASE }} runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - with: - ref: ${{ github.sha }} - # we need this commit + the last so we can compare below - fetch-depth: 2 - # exit early if the version has not changed - - name: Check Release - id: check-release - run: ./scripts/check-release.sh ${{ github.event.before }} + - uses: MetaMask/action-is-release@v1.0 + id: is-release publish-release: permissions: contents: write - if: needs.check-release.outputs.IS_RELEASE == 'true' + if: needs.is-release.outputs.IS_RELEASE == 'true' runs-on: ubuntu-latest - needs: check-release + needs: is-release steps: - uses: actions/checkout@v2 with: diff --git a/scripts/check-release.sh b/scripts/check-release.sh deleted file mode 100755 index 31e7806a..00000000 --- a/scripts/check-release.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env bash - -set -x -set -e -set -o pipefail - -BEFORE="${1}" - -if [[ -z $BEFORE ]]; then - echo "Error: Before SHA not specified." - exit 1 -fi - -VERSION_BEFORE="$(git show "$BEFORE":package.json | jq --raw-output .version)" -VERSION_AFTER="$(jq --raw-output .version package.json)" -if [[ "$VERSION_BEFORE" == "$VERSION_AFTER" ]]; then - echo "Notice: version unchanged. Skipping release." - echo "::set-output name=IS_RELEASE::false" - exit 0 -fi - -echo "::set-output name=IS_RELEASE::true"