diff --git a/.github/workflows/code-formatting-cleanup-pr.yml b/.github/workflows/code-formatting-cleanup-pr.yml new file mode 100644 index 0000000000000..4a08127469cff --- /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 9d1900983842d..8c6c46a2e86af 100644 --- a/.github/workflows/code-formatting.yml +++ b/.github/workflows/code-formatting.yml @@ -1,11 +1,11 @@ --- name: Formatting -'on': [pull_request_target] +'on': [pull_request] + +permissions: {} jobs: formatting: name: PR formatting uses: alisw/ali-bot/.github/workflows/c++-code-formatting.yml@master - secrets: - alibuild_github_token: ${{ secrets.ALIBUILD_GITHUB_TOKEN }}