From 39dd5ca69c6b4d46d6b911dffd55e4d3d255ef91 Mon Sep 17 00:00:00 2001 From: kushalm Date: Tue, 5 Sep 2023 01:17:39 +0400 Subject: [PATCH] chore: Create tag workflow updated --- .github/workflows/check_version.yml | 2 ++ .github/workflows/create_tag.yml | 11 +++++++++-- .github/workflows/pull_request_opened.yml | 1 - .github/workflows/trigger_on_pr_merge.yml | 2 ++ 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/check_version.yml b/.github/workflows/check_version.yml index 60a78c3..c151108 100644 --- a/.github/workflows/check_version.yml +++ b/.github/workflows/check_version.yml @@ -1,6 +1,8 @@ name: Check Version on: + workflow_call: + pull_request: branches: - main diff --git a/.github/workflows/create_tag.yml b/.github/workflows/create_tag.yml index 047d041..86c987c 100644 --- a/.github/workflows/create_tag.yml +++ b/.github/workflows/create_tag.yml @@ -13,6 +13,12 @@ jobs: steps: - name: Placeholder Step run: echo "This is a placeholder job" + + call-check-version: + uses: ./.github/workflows/check_version.yml + + call-trigger-create-tag-and-publish: + uses: ./.github/workflows/trigger_on_pr_merge.yml create-tag-and-publish: permissions: @@ -22,9 +28,10 @@ jobs: pull-requests: write runs-on: ubuntu-latest - needs: [placeholder-job, check-version, trigger-create-tag-and-publish] + needs: [placeholder-job, call-check-version, call-trigger-create-tag-and-publish] + - if: ${{ needs.check-version.outputs.TRIGGER_NEXT_ACTION == 'true' && needs.trigger-create-tag-and-publish.outputs.TRIGGER_CREATE_TAG_AND_PUBLISH == 'true' }} + if: ${{ needs.call-check-version.outputs.TRIGGER_NEXT_ACTION == 'true' && needs.call-trigger-create-tag-and-publish.outputs.TRIGGER_CREATE_TAG_AND_PUBLISH == 'true' }} steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/pull_request_opened.yml b/.github/workflows/pull_request_opened.yml index e8af2e0..41e952f 100644 --- a/.github/workflows/pull_request_opened.yml +++ b/.github/workflows/pull_request_opened.yml @@ -23,7 +23,6 @@ jobs: pr-labeler: name: Label the PR based on the branch - # needs: security_hardening permissions: contents: read pull-requests: write diff --git a/.github/workflows/trigger_on_pr_merge.yml b/.github/workflows/trigger_on_pr_merge.yml index 628104b..7c43060 100644 --- a/.github/workflows/trigger_on_pr_merge.yml +++ b/.github/workflows/trigger_on_pr_merge.yml @@ -1,6 +1,8 @@ name: Trigger Create Tag and Publish Workflow on PR Merge on: + workflow_call: + pull_request: types: - closed