Skip to content

Commit

Permalink
🧪 Make a draft based plugin bump PR CI trigger
Browse files Browse the repository at this point in the history
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:
* github/codeql-action#2263 (comment)
* https://github.com/github/codeql-action/blob/4ebadbc7/.github/workflows/update-dependencies.yml#L38-L41
* github/codeql-action#1868
* github/codeql-action#679
  • Loading branch information
webknjaz committed Jun 21, 2024
1 parent b08b6d1 commit 323b0bd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/update-plugin-list.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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 }}'

0 comments on commit 323b0bd

Please sign in to comment.