From 1e65154b48129947a30dfd9767c90c3564c8ec6f Mon Sep 17 00:00:00 2001 From: kdoroszko-splunk <147069837+kdoroszko-splunk@users.noreply.github.com> Date: Thu, 4 Jan 2024 12:45:42 +0100 Subject: [PATCH] feat: pre-publish job adjusted to triggering event (#212) This PR regards https://splunk.atlassian.net/browse/ADDON-67617 It introduces dynamic change of pre-publish job which was necessary to avoid confusion while creating PR towards main branch having had pushed to develop branch. tests: - pr: https://github.com/splunk/splunk-add-on-for-mysql/pull/464 - push to develop workflow (name has been changed): https://github.com/splunk/splunk-add-on-for-mysql/actions/runs/7399079510 - pr to main workflow (name remains intact): https://github.com/splunk/splunk-add-on-for-mysql/actions/runs/7399125452 --- .github/workflows/reusable-build-test-release.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/reusable-build-test-release.yml b/.github/workflows/reusable-build-test-release.yml index 0368536aa..9ee5d7237 100644 --- a/.github/workflows/reusable-build-test-release.yml +++ b/.github/workflows/reusable-build-test-release.yml @@ -2671,6 +2671,10 @@ jobs: pre-publish: if: ${{ !cancelled() }} + # The following line will rename 'pre-publish' to 'pre-publish-not_main_pr' when PR is created towards main branch + # It is necessary to avoid confusion caused by githubactions considering pre-publish for both push to develop branch + # and pull_request to main branch events. + name: ${{ github.event_name == 'pull_request' && github.base_ref == 'main' && 'pre-publish' || 'pre-publish-not_main_pr' }} needs: - meta - compliance-copyrights