Skip to content

Commit b9ca784

Browse files
authored
ci build: prevent duplicated GitHub Release from being created (#103)
## Problem The following error happened during release. ``` Run gh release create "${GITHUB_REF_NAME}" \ HTTP 422: Validation Failed (https://api.github.com/repos/mroonga/docker/releases) Release.tag_name already exists Error: Process completed with exit code 1. ``` ## Cause The `Create GitHub Release` step only checked `github.ref_type == 'tag'`, so every matrix entry (e.g. "mysql-8.0" and "mysql-8.4") tried to publish the release page. ## Solution We add the condtion that we will create Release page only when the tag matches the workflow's `matrix.id`.
1 parent 07b05f5 commit b9ca784

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ jobs:
7777
* Digest: \`${{ steps.docker_build.outputs.digest }}\`
7878
RELEASE_NOTE
7979
- name: Create GitHub Release
80-
if: github.ref_type == 'tag'
80+
if: github.ref_type == 'tag' && startsWith(github.ref_name, matrix.id)
8181
env:
8282
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8383
run: |

0 commit comments

Comments
 (0)