ci: update conditions at which CI runs (#2761)

* ci(conventional-labels.yml): update pull_request_target event types to remove unnecessary spaces and adjust pull_request_review event types to only trigger on submitted actions

* feat: add condition to run path-filter job only if PR is approved, manual run, or not a draft PR
This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-07-17 13:56:28 -03:00 committed by GitHub
commit c15e8ace8a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 5 deletions

View file

@ -16,7 +16,8 @@ on:
description: "Store API Key"
required: false
type: string
pull_request:
pull_request_review:
types: [submitted]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
@ -24,6 +25,8 @@ concurrency:
jobs:
path-filter:
# should run if the PR is approved,or if it's a manual run or if it is not a draft PR
if: ${{github.event.review.state == 'APPROVED' || github.event_name == 'workflow_dispatch' || github.event.pull_request.draft == false}}
name: Filter Paths
runs-on: ubuntu-latest
outputs:
@ -74,8 +77,7 @@ jobs:
ci_success:
name: "CI Success"
needs: [test-backend, test-frontend, lint-backend, test-docs-build]
if: |
always()
if: always()
runs-on: ubuntu-latest
env:
JOBS_JSON: ${{ toJSON(needs) }}
@ -87,4 +89,4 @@ jobs:
echo $JOBS_JSON
echo $RESULTS_JSON
echo "Exiting with $EXIT_CODE"
exit $EXIT_CODE
exit $EXIT_CODE

View file

@ -3,7 +3,9 @@
name: Label PRs with Conventional Commits
on:
pull_request_target:
types: [ opened, edited , reopened, auto_merge_enabled]
types: [opened, edited]
pull_request_review:
types: [submitted]
jobs:
validate-pr: