Skip to content

Commit

Permalink
chore: Create tag workflow updated
Browse files Browse the repository at this point in the history
  • Loading branch information
kushalmahapatro committed Sep 4, 2023
1 parent 39dd5ca commit b1dea95
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/check_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ name: Check Version

on:
workflow_call:
secrets:
TRIGGER_NEXT_ACTION:
required: true
description: 'Trigger Next Action'

pull_request:
branches:
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/create_tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@ jobs:

call-check-version:
uses: ./.github/workflows/check_version.yml
secrets:
TRIGGER_NEXT_ACTION: ${{ secrets.TRIGGER_NEXT_ACTION }}

call-trigger-create-tag-and-publish:
uses: ./.github/workflows/trigger_on_pr_merge.yml
secrets:
TRIGGER_CREATE_TAG_AND_PUBLISH: ${{ secrets.TRIGGER_CREATE_TAG_AND_PUBLISH }}

create-tag-and-publish:
permissions:
Expand All @@ -31,7 +35,7 @@ jobs:
needs: [placeholder-job, call-check-version, call-trigger-create-tag-and-publish]


if: ${{ needs.call-check-version.outputs.TRIGGER_NEXT_ACTION == 'true' && needs.call-trigger-create-tag-and-publish.outputs.TRIGGER_CREATE_TAG_AND_PUBLISH == 'true' }}
if: ${{ needs.call-check-version.TRIGGER_NEXT_ACTION == 'true' && needs.call-trigger-create-tag-and-publish.TRIGGER_CREATE_TAG_AND_PUBLISH == 'true' }}

steps:
- uses: actions/checkout@v3
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/trigger_on_pr_merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@ name: Trigger Create Tag and Publish Workflow on PR Merge

on:
workflow_call:

secrets:
TRIGGER_CREATE_TAG_AND_PUBLISH:
required: true
description: |
Set to true to trigger the Create Tag and Publish workflow.
Set to false to not trigger the Create Tag and Publish workflow.
Set to anything else to not trigger the Create Tag and Publish workflow.
pull_request:
types:
- closed
Expand All @@ -23,6 +30,7 @@ jobs:
- name: Set trigger_create_tag_and_publish output
id: set_output
run: echo "set-env:TRIGGER_CREATE_TAG_AND_PUBLISH=${{ steps.check_merged.outputs.outputs.result}}" >> $GITHUB_ENV
env:
TRIGGER_CREATE_TAG_AND_PUBLISH: ${{ steps.check_merged.outputs.outputs.result}}
run: echo "set-env:TRIGGER_CREATE_TAG_AND_PUBLISH=${{ steps.check_merged.outputs.outputs.result}}" >> $GITHUB_ENV

0 comments on commit b1dea95

Please sign in to comment.