Skip to content
name: Push a new tag when PR with specified labels was merged
on:
pull_request:
types: [closed]
jobs:
tagged:
runs-on: ubuntu-latest
steps:
- uses: actions-ecosystem/action-release-label@v1
id: release-label
if: ${{ github.event.pull_request.merged == true }}
- uses: actions/checkout@v4
if: ${{ steps.release-label.outputs.level != null }}
with:
# to trigger release.yml Action
token: ${{ secrets.TOKEN }}
- uses: imranismail/setup-kustomize@v2
- uses: actions-ecosystem/action-get-latest-tag@v1
id: get-latest-tag
if: ${{ steps.release-label.outputs.level != null }}
- uses: actions-ecosystem/action-bump-semver@v1
id: bump-semver
if: ${{ steps.release-label.outputs.level != null }}
with:
current_version: ${{ steps.get-latest-tag.outputs.tag }}
level: ${{ steps.release-label.outputs.level }}
- id: push-tag
if: ${{ steps.release-label.outputs.level != null }}
run: |
git config user.email "action@users.noreply.github.com"
git config user.name "GitHub Action"
git switch test
: # update manifest's tag
cd manifests/base/
kustomize edit set image kanatakita/kube-portal:${{ steps.bump-semver.outputs.new_version }}
cd ..
kustomize build install/ > ./install.yaml
: # commit the above & grant a tag for new_version
git add .
git commit -m "update manifests"
git tag ${{ steps.bump-semver.outputs.new_version }}
: # revert the commit & push to origin
git revert HEAD --no-edit
git push origin HEAD
git push origin ${{ steps.bump-semver.outputs.new_version }}