diff options
| author | Павел Жуков <33721692+LeaveMyYard@users.noreply.github.com> | 2023-05-28 01:57:23 +0300 |
|---|---|---|
| committer | Павел Жуков <33721692+LeaveMyYard@users.noreply.github.com> | 2023-05-28 01:57:23 +0300 |
| commit | 403d8310f29dfafc0f4a617431fca71a9632cdee (patch) | |
| tree | be59d85f2629cc77352300c36ad08230cf7a31b0 /.github | |
| parent | 14b76496ae104ab04081282749fb2338697b66e3 (diff) | |
Rework skip on not latest update
Diffstat (limited to '.github')
| -rw-r--r-- | .github/workflows/build-on-release.yml | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/.github/workflows/build-on-release.yml b/.github/workflows/build-on-release.yml index 1ee966f..8e24ab4 100644 --- a/.github/workflows/build-on-release.yml +++ b/.github/workflows/build-on-release.yml @@ -110,7 +110,6 @@ jobs: mac-hash: needs: build runs-on: ubuntu-latest - if: github.event.release.id == github.event.repository.latest_release.id outputs: MAC_BUILD_HASH: ${{ steps.calc-hash.outputs.MAC_BUILD_HASH }} steps: @@ -148,6 +147,22 @@ jobs: runs-on: ubuntu-latest if: github.event.release.id == github.event.repository.latest_release.id steps: + - name: Check if latest release + id: check + run: | + LATEST_RELEASE=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/robusta-dev/krr/releases/latest | jq -r .tag_name) + CURRENT_RELEASE=${{ github.ref_name }} + if [ "$LATEST_RELEASE" != "$CURRENT_RELEASE" ]; then + echo "::set-output name=is_latest::false" + else + echo "::set-output name=is_latest::true" + fi + - name: Fail if not latest release + if: steps.check.outputs.is_latest != 'true' + continue-on-error: true + run: | + echo "Not the latest release, cancelling job" + exit 1 - name: Checkout homebrew-krr repository uses: actions/checkout@v2 with: |
