Skip to content

Commit

Permalink
ensure minor and major tags point to the right commit
Browse files Browse the repository at this point in the history
If you use `pull_request_target` or you've had another commit to your repo since this started running or you're using merge trains then the latest commit might not be the right commit. Instead ensure the semver tags are pointing to the same commit as the target tag.
  • Loading branch information
cardoe authored Mar 6, 2023
1 parent fb48464 commit 9426ddd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"

# Update MAJOR/MINOR tag
git tag -fa "${MAJOR}" -m "${MESSAGE}"
git tag -fa "${MAJOR}" -m "${MESSAGE}" "${TAG}^{}"
[ "${MAJOR_VERSION_TAG_ONLY}" = "true" ] || git tag -fa "${MINOR}" -m "${MESSAGE}"

# Set up remote url for checkout@v1 action.
Expand All @@ -31,4 +31,4 @@ fi

# Push
[ "${MAJOR_VERSION_TAG_ONLY}" = "true" ] || git push --force origin "${MINOR}"
git push --force origin "${MAJOR}"
git push --force origin "${MAJOR}" "${TAG}^{}"

0 comments on commit 9426ddd

Please sign in to comment.