From 78edf05e524d8b0ddb4b2728555d1d68f6f175d3 Mon Sep 17 00:00:00 2001 From: Jens Troeger Date: Sat, 8 Oct 2022 11:43:48 +1000 Subject: [PATCH] fix(ci): split PR workflow into two to handle events separately --- .github/workflows/pr-change-set.yaml | 26 +++++++++++++++++++ ...uest.yaml => pr-conventional-commits.yaml} | 10 +------ 2 files changed, 27 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/pr-change-set.yaml rename .github/workflows/{pull-request.yaml => pr-conventional-commits.yaml} (88%) diff --git a/.github/workflows/pr-change-set.yaml b/.github/workflows/pr-change-set.yaml new file mode 100644 index 00000000..265b3ca5 --- /dev/null +++ b/.github/workflows/pr-change-set.yaml @@ -0,0 +1,26 @@ +# This workflow checks and tests the package code, and it builds all package +# artifacts whenever there were changes to a pull request. + +name: 'Pull Request: change set' +on: + pull_request: + branches: + - main + - staging + types: + - opened + - reopened + - synchronize +permissions: + contents: read + +jobs: + + # If the build workflow needs to access secrets, they need to be passed using `secrets: inherit`. + # See https://docs.github.com/en/actions/using-workflows/reusing-workflows to learn more. + # See https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions + # for the security recommendations. + build: + uses: ./.github/workflows/build.yaml + permissions: + contents: read diff --git a/.github/workflows/pull-request.yaml b/.github/workflows/pr-conventional-commits.yaml similarity index 88% rename from .github/workflows/pull-request.yaml rename to .github/workflows/pr-conventional-commits.yaml index abbc54c4..6ab2590a 100644 --- a/.github/workflows/pull-request.yaml +++ b/.github/workflows/pr-conventional-commits.yaml @@ -3,7 +3,7 @@ # tool to check the title of the PR and all commit messages of the branch # which triggers this Action. -name: Pull Request +name: 'Pull Request: conventional commits' on: pull_request: branches: @@ -19,7 +19,6 @@ permissions: jobs: conventional-commits: - name: Check PR title and commit messages runs-on: ubuntu-latest steps: @@ -55,10 +54,3 @@ jobs: PR_BASE_REF: ${{ github.event.pull_request.base.ref }} PR_HEAD_REF: ${{ github.event.pull_request.head.ref }} PR_HEAD_REPO_CLONE_URL: ${{ github.event.pull_request.head.repo.clone_url }} - - build: - needs: conventional-commits - if: ${{ github.event.action != 'edited' }} - uses: ./.github/workflows/build.yaml - permissions: - contents: read