Skip to content

Commit

Permalink
Merge pull request #7 from weierophinney/hotfix/fix-tag-discovery
Browse files Browse the repository at this point in the history
Strip refs/tags prefix from GITHUB_REF in workflows
  • Loading branch information
weierophinney authored Mar 3, 2021
2 parents 71ee62d + e9b4808 commit c430a75
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/build-and-push-containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ jobs:
- name: Compile tag list
id: tags
run: |
TAG=${GITHUB_REF/refs\/tags\//}
PREFIX=ghrc.io/laminas/laminas-ci-matrix
MAJOR="${PREFIX}:$(echo ${GITHUB_REF} | cut -d. -f1)"
MINOR="${MAJOR}.$(echo ${GITHUB_REF} | cut -d. -f2)"
PATCH="${PREFIX}:${GITHUB_REF}"
MAJOR="${PREFIX}:$(echo ${TAG} | cut -d. -f1)"
MINOR="${MAJOR}.$(echo ${TAG} | cut -d. -f2)"
PATCH="${PREFIX}:${TAG}"
echo "::set-output name=tags::${MAJOR}%0A${MINOR}%0A${PATCH}"
release-container:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/create-additional-action-tags.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ jobs:
- name: Compile tag list
id: tags
run: |
MAJOR="v$(echo ${GITHUB_REF} | cut -d. -f1)"
TAG=${GITHUB_REF/refs\/tags\//}
MAJOR="v$(echo ${TAG} | cut -d. -f1)"
MINOR="${MAJOR}.$(echo ${GITHUB_REF} | cut -d. -f2)"
echo "::set-output name=tags::${MAJOR}%0A${MINOR}"
Expand All @@ -29,6 +30,7 @@ jobs:
ORIGINAL_TAG: ${{ github.ref }}
TAGS: ${{ needs.tags.outputs.tags }}
run: |
ORIGINAL_TAG=${ORIGINAL_TAG/refs\/tags\//}
for TAG in ${TAGS};do
echo "Creating and pushing ${TAG}"
git tag -f ${TAG} ${ORIGINAL_TAG}
Expand Down

0 comments on commit c430a75

Please sign in to comment.