From 5e716572c7376a0ed5f8b65c67592e6cf15daafa Mon Sep 17 00:00:00 2001 From: Chris Aslanoglou Date: Fri, 1 Dec 2023 14:29:13 +0200 Subject: [PATCH] chore(release): fetch `main` to validate tag is from commit in said ref Due to the way we checkout the code, only the triggering ref will be available, thus `main` isn't known to the local git repo. We add a `git fetch main` in the "ensure release happens on a commit merged in main ref" validation step. [no-jira] --- .github/workflows/release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d950716..2b39c58 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,6 +23,8 @@ jobs: - name: Issue a release only if a tag is based on a merged commit in `main` branch run: | tag_commit=$(git rev-parse ${{ github.ref }}) + + git fetch -f origin main merged_commit=$(git rev-parse main) if git merge-base --is-ancestor $tag_commit $merged_commit; then