From 275d5cd10bc570554a3dca46ba13b2708ac3a735 Mon Sep 17 00:00:00 2001 From: Jens Troeger Date: Tue, 4 Oct 2022 23:58:01 +1000 Subject: [PATCH 1/6] =?UTF-8?q?fix:=20don=E2=80=99t=20build=20anew=20if=20?= =?UTF-8?q?a=20PR=20was=20simply=20edited?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pull-request.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pull-request.yaml b/.github/workflows/pull-request.yaml index 53ec82fc..abbc54c4 100644 --- a/.github/workflows/pull-request.yaml +++ b/.github/workflows/pull-request.yaml @@ -58,6 +58,7 @@ jobs: build: needs: conventional-commits + if: ${{ github.event.action != 'edited' }} uses: ./.github/workflows/build.yaml permissions: contents: read From 78edf05e524d8b0ddb4b2728555d1d68f6f175d3 Mon Sep 17 00:00:00 2001 From: Jens Troeger Date: Sat, 8 Oct 2022 11:43:48 +1000 Subject: [PATCH 2/6] 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 From 1a4900edcdc3e880f0868c41a1974dc4967fbe4e Mon Sep 17 00:00:00 2001 From: Jens Troeger Date: Mon, 10 Oct 2022 07:54:52 +1000 Subject: [PATCH 3/6] =?UTF-8?q?fix:=20break=20the=20code=20=F0=9F=98=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/package/something.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/package/something.py b/src/package/something.py index c89fcf2a..24a9bf33 100644 --- a/src/package/something.py +++ b/src/package/something.py @@ -5,6 +5,6 @@ class Something: """The Something class provides some things.""" @staticmethod - def do_something(value: bool = False) -> bool: + def do_something(value: bool = False) -> str: """Return true, always.""" return value or True From a3af1c30a6869432de35d52021a07994f9e6c7d2 Mon Sep 17 00:00:00 2001 From: Jens Troeger Date: Mon, 10 Oct 2022 08:33:17 +1000 Subject: [PATCH 4/6] =?UTF-8?q?fix:=20unbreak=20the=20code=20=F0=9F=98=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/package/something.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/package/something.py b/src/package/something.py index 24a9bf33..c89fcf2a 100644 --- a/src/package/something.py +++ b/src/package/something.py @@ -5,6 +5,6 @@ class Something: """The Something class provides some things.""" @staticmethod - def do_something(value: bool = False) -> str: + def do_something(value: bool = False) -> bool: """Return true, always.""" return value or True From e76f2cdc40a566205c6dfedc07b004f5617261db Mon Sep 17 00:00:00 2001 From: Jens Troeger Date: Mon, 10 Oct 2022 08:40:22 +1000 Subject: [PATCH 5/6] chore: remove comment because it's duplicated from build.yaml --- .github/workflows/pr-change-set.yaml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/pr-change-set.yaml b/.github/workflows/pr-change-set.yaml index 265b3ca5..b3dd7407 100644 --- a/.github/workflows/pr-change-set.yaml +++ b/.github/workflows/pr-change-set.yaml @@ -15,11 +15,6 @@ 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: From bd8d88b09ac1f71ab8d4c78c0a8c7335e3536f94 Mon Sep 17 00:00:00 2001 From: Jens Troeger Date: Wed, 12 Oct 2022 07:51:35 +1000 Subject: [PATCH 6/6] chore: change Action names --- .github/workflows/pr-change-set.yaml | 2 +- .github/workflows/pr-conventional-commits.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr-change-set.yaml b/.github/workflows/pr-change-set.yaml index b3dd7407..8efcbce5 100644 --- a/.github/workflows/pr-change-set.yaml +++ b/.github/workflows/pr-change-set.yaml @@ -1,7 +1,7 @@ # 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' +name: Check change set on: pull_request: branches: diff --git a/.github/workflows/pr-conventional-commits.yaml b/.github/workflows/pr-conventional-commits.yaml index 6ab2590a..9b8f5e3f 100644 --- a/.github/workflows/pr-conventional-commits.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: conventional commits' +name: Check conventional commits on: pull_request: branches: