Skip to content

Commit

Permalink
updates to the ci workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
yajith committed Sep 24, 2024
1 parent 3be007e commit 2382f8c
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/portainer-updater.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,24 +50,25 @@ jobs:

- name: '[preparation] set the container image tag'
run: |
# set the container image tag suffix
TAG_SUFFIX="${{ matrix.config.platform }}${{ matrix.config.version }}-${{ matrix.config.arch }}"
# set the container image tag prefix
# set the container image tag
if [[ "${GITHUB_REF_NAME}" =~ ^release/.*$ ]]; then
# use the release branch name as the tag for release branches
# for instance, release/2.19 becomes 2.19
echo "TAG_PREFIX=$(echo $GITHUB_REF_NAME | cut -d '/' -f 2)" >> $GITHUB_ENV
TAG_PREFIX=$(echo $GITHUB_REF_NAME | cut -d "/" -f 2)
elif [ "${GITHUB_EVENT_NAME}" == "pull_request" ]; then
# use pr${{ github.event.number }} as the tag for pull requests
# for instance, pr123
echo "TAG_PREFIX=pr${{ github.event.number }}" >> $GITHUB_ENV
TAG_PREFIX="pr${{ github.event.number }}"
else
# replace / with - in the branch name
# for instance, feature/1.0.0 -> feature-1.0.0
echo "TAG_PREFIX=$(echo $GITHUB_REF_NAME | sed 's/\//-/g')" >> $GITHUB_ENV
TAG_PREFIX=$(echo $GITHUB_REF_NAME | sed 's/\//-/g')
fi
echo "TAG_PREFIX=${TAG_PREFIX}" >> $GITHUB_ENV
TAG_SUFFIX="${{ matrix.config.platform }}${{ matrix.config.version }}-${{ matrix.config.arch }}"
echo "TAG_SUFFIX=${TAG_SUFFIX}" >> $GITHUB_ENV

# set the container image tag
echo "CONTAINER_IMAGE_TAG=${TAG_PREFIX}-${TAG_SUFFIX}" >> $GITHUB_ENV

Expand Down

0 comments on commit 2382f8c

Please sign in to comment.