diff --git a/.github/workflows/deploy-dev.yml b/.github/workflows/deploy-dev.yml index 1a03e0d33..0ec31b053 100644 --- a/.github/workflows/deploy-dev.yml +++ b/.github/workflows/deploy-dev.yml @@ -9,7 +9,7 @@ on: jobs: validate-actor: - # Run only for workflow_dispatch events with a merged pull request + # Run only for workflow_dispatch events if: github.event_name == 'workflow_dispatch' uses: ./.github/workflows/validate-actor.yml secrets: diff --git a/.github/workflows/deploy-npm.yml b/.github/workflows/deploy-npm.yml index 120dfea3d..196b86438 100644 --- a/.github/workflows/deploy-npm.yml +++ b/.github/workflows/deploy-npm.yml @@ -26,10 +26,8 @@ env: jobs: validate-actor: - # Run validation for workflow_dispatch with tags - if: > - github.event_name == 'workflow_dispatch' && - startsWith(github.ref, 'refs/tags/v') + # Run validation for workflow_dispatch + if: github.event_name == 'workflow_dispatch' uses: ./.github/workflows/validate-actor.yml secrets: PAT: ${{ secrets.PAT }} @@ -42,7 +40,14 @@ jobs: # Deploy if validate-actor was successful or skipped # or if the workflow was invoked by another workflow if: > - (needs.validate-actor.result == 'success' || needs.validate-actor.result == 'skipped') || inputs.is_called == 'true' + (needs.validate-actor.result == 'success' || needs.validate-actor.result == 'skipped') && + ( + inputs.is_called == 'true' || + ( + github.event_name == 'workflow_dispatch' && + startsWith(github.ref, 'refs/tags/v') + ) + ) steps: - name: Checkout diff --git a/.github/workflows/deploy-staging.yml b/.github/workflows/deploy-staging.yml index 264355894..1c7333e0b 100644 --- a/.github/workflows/deploy-staging.yml +++ b/.github/workflows/deploy-staging.yml @@ -11,13 +11,7 @@ on: jobs: validate-actor: - if: > - github.event_name == 'workflow_dispatch' && - ( - startsWith(github.ref, 'refs/tags/v') || - startsWith(github.head_ref, 'hotfix-release/') || - startsWith(github.head_ref, 'release/') - ) + if: github.event_name == 'workflow_dispatch' uses: ./.github/workflows/validate-actor.yml secrets: PAT: ${{ secrets.PAT }} diff --git a/.github/workflows/validate-actor.yml b/.github/workflows/validate-actor.yml index 3050ef9da..cae157a7a 100644 --- a/.github/workflows/validate-actor.yml +++ b/.github/workflows/validate-actor.yml @@ -28,7 +28,7 @@ jobs: fi # Extract the state of the membership - if echo "$response" | grep -q '"state": "active"'; then + if echo "$response" | grep -q '"state":"active"'; then echo "'$actor' is a member of '@${ORG_NAME}/${TEAM_NAME}' team" else echo "Error: '$actor' is NOT a member of '@${ORG_NAME}/${TEAM_NAME}' team. Access denied."