diff --git a/.github/workflows/code-formatting-cleanup-pr.yml b/.github/workflows/code-formatting-cleanup-pr.yml new file mode 100644 index 00000000000..4a08127469c --- /dev/null +++ b/.github/workflows/code-formatting-cleanup-pr.yml @@ -0,0 +1,21 @@ +--- +name: Formatting cleanup PR + +'on': + workflow_run: + workflows: ["Formatting"] # must match the name of that repo's unprivileged caller + types: [completed] + +permissions: {} + +jobs: + cleanup: + if: >- + github.event.workflow_run.event == 'pull_request' && + github.event.workflow_run.conclusion != 'cancelled' + permissions: + actions: read + pull-requests: read + uses: alisw/ali-bot/.github/workflows/c++-code-formatting-cleanup-pr.yml@master + secrets: + alibuild_github_token: ${{ secrets.ALIBUILD_GITHUB_TOKEN }} diff --git a/.github/workflows/code-formatting.yml b/.github/workflows/code-formatting.yml index d3e0bb47650..8c6c46a2e86 100644 --- a/.github/workflows/code-formatting.yml +++ b/.github/workflows/code-formatting.yml @@ -1,7 +1,7 @@ --- name: Formatting -'on': [pull_request_target] +'on': [pull_request] permissions: {} @@ -9,5 +9,3 @@ jobs: formatting: name: PR formatting uses: alisw/ali-bot/.github/workflows/c++-code-formatting.yml@master - secrets: - alibuild_github_token: ${{ secrets.ALIBUILD_GITHUB_TOKEN }}