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 committed Mar 6, 2023
1 parent fb48464 commit 0bb3fe4
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,8 +21,8 @@ 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}"
[ "${MAJOR_VERSION_TAG_ONLY}" = "true" ] || git tag -fa "${MINOR}" -m "${MESSAGE}"
git tag -fa "${MAJOR}" -m "${MESSAGE}" "${TAG}^{}"
[ "${MAJOR_VERSION_TAG_ONLY}" = "true" ] || git tag -fa "${MINOR}" -m "${MESSAGE}" "${TAG}^{}"

# Set up remote url for checkout@v1 action.
if [ -n "${INPUT_GITHUB_TOKEN}" ]; then
Expand Down

0 comments on commit 0bb3fe4

Please sign in to comment.