Skip to content

Commit

Permalink
Do not release a duplicate for the same hash (#57)
Browse files Browse the repository at this point in the history
* Do not release a duplicate for the same hash

* Do not release a duplicate for the same hash

* update

* update

* update
  • Loading branch information
max-lobur authored Jun 1, 2023
1 parent 448298d commit 662776e
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/controller-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,28 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Fetch pull request for the given ref
id: get-pull-request
uses: 8BitJonny/[email protected]
with:
sha: ${{ inputs.sha }}

- name: Check duplicate
id: check-duplicate
run: |
latest_hash=$(git rev-parse ${{ github.ref_name }})
tags=$(git tag --contains "$latest_hash")
if [[ -n $tags ]]; then
echo "duplicate=true" >> "$GITHUB_OUTPUT"
else
echo "duplicate=false" >> "$GITHUB_OUTPUT"
fi
- name: Do release
if: steps.check-duplicate.outputs.duplicate == 'false'
id: release
uses: release-drafter/release-drafter@v5
with:
Expand All @@ -80,6 +94,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.github_access_token || secrets.GITHUB_TOKEN }}

- name: Verify release # Workaround for https://github.com/release-drafter/release-drafter/issues/1313
if: steps.check-duplicate.outputs.duplicate == 'false'
shell: bash
run: |
echo 'Checking release id not empty: "${{ steps.release.outputs.id }}"'
Expand Down

0 comments on commit 662776e

Please sign in to comment.