-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not release a duplicate for the same hash (#57)
* Do not release a duplicate for the same hash * Do not release a duplicate for the same hash * update * update * update
- Loading branch information
Showing
1 changed file
with
15 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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: | ||
|
@@ -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 }}"' | ||
|