From 8819669169adf15bface6520467f22d3a0bbd101 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Thu, 20 Jun 2024 20:14:31 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=AA=20Make=20a=20draft=20based=20plugi?= =?UTF-8?q?n=20bump=20PR=20CI=20trigger?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Normally, PRs/commits published using the default GitHub Actions CI/CD API token are not propagated to any integrations. This patch marks the plugin update PR as a draft and leaves a comment asking the maintainers to mark it as ready for review in order to actually trigger a CI run. This idea is found in GitHub's own repos: * https://github.com/github/codeql-action/pull/2263#issuecomment-2078311173 * https://github.com/github/codeql-action/blob/4ebadbc7/.github/workflows/update-dependencies.yml#L38-L41 * https://github.com/github/codeql-action/pull/1868 * https://github.com/github/codeql-action/pull/679 --- .github/workflows/test.yml | 5 +++++ .github/workflows/update-plugin-list.yml | 11 +++++++++++ 2 files changed, 16 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d16ce0edf93..adc03a8c284 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,6 +14,11 @@ on: branches: - main - "[0-9]+.[0-9]+.x" + types: + - opened # default + - synchronize # default + - reopened # default + - ready_for_review # used in PRs created from the release workflow env: PYTEST_ADDOPTS: "--color=yes" diff --git a/.github/workflows/update-plugin-list.yml b/.github/workflows/update-plugin-list.yml index 1015d01c9c6..4da55e6d5a2 100644 --- a/.github/workflows/update-plugin-list.yml +++ b/.github/workflows/update-plugin-list.yml @@ -46,6 +46,7 @@ jobs: run: python scripts/update-plugin-list.py - name: Create Pull Request + id: pr uses: peter-evans/create-pull-request@6d6857d36972b65feb161a90e484f2984215f83e with: commit-message: '[automated] Update plugin list' @@ -55,3 +56,13 @@ jobs: branch-suffix: short-commit-hash title: '[automated] Update plugin list' body: '[automated] Update plugin list' + draft: true + + - name: Instruct the maintainers to trigger CI by undrafting the PR + env: + GITHUB_TOKEN: ${{ github.token }} + run: >- + gh pr comment + --body 'Please mark the PR as ready for review to trigger PR checks.' + --repo '${{ github.repository }}' + '${{ steps.pr.outputs.pull-request-number }}'