From c4096c0ed8f385e666a9b9dfce6a5c2031eee268 Mon Sep 17 00:00:00 2001 From: Frederik Berlaen Date: Tue, 12 Mar 2024 23:08:34 +0100 Subject: [PATCH] Update pr_to_tag.yml --- .github/workflows/pr_to_tag.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/pr_to_tag.yml b/.github/workflows/pr_to_tag.yml index 63b1b8d..9569edc 100644 --- a/.github/workflows/pr_to_tag.yml +++ b/.github/workflows/pr_to_tag.yml @@ -1,13 +1,11 @@ name: Create a tag on: - pull_request: - types: [closed] + push permissions: write-all jobs: create_tag_from_pr: - if: github.event.pull_request.merged == true runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -18,14 +16,16 @@ jobs: with: file-path: info.yaml - - name: Content yaml + - name: Read version from yaml run : | - echo ${{ steps.info-action.outputs }} - echo ${{ steps.info-action.outputs.version }} + echo version: ${{ steps.info-action.outputs.version }} - name: Create tag if not present - uses: rickstaa/action-create-tag@v1 - continue-on-error: true - with: - tag: ${{ steps.info-action.outputs.version }} - force_push_tag: true + run: | + if [ $(git tag -l "${{ steps.info-action.outputs.version }}") ]; then + echo "Tag ${{ steps.info-action.outputs.version }} exists" + else + echo "Create tag ${{ steps.info-action.outputs.version }}" + git tag ${{ steps.info-action.outputs.version }} + git push --follow-tags + fi