helm-charts
helm-charts copied to clipboard
PRs open by automation don't trigger CI runs
PRs such as: https://github.com/kubewarden/helm-charts/pull/322 https://github.com/kubewarden/helm-charts/pull/308
Don't trigger CI runs for themselves.
The PRs get triggered by using peter-evans/repository-dispatch
, see:
https://github.com/kubewarden/policy-server/blob/dbd4e8dc0283c13c842c371e86436c6f28f69dfb/.github/workflows/release.yml#L129C37-L132
Searching on the interwebs I reached: https://github.com/orgs/community/discussions/25602 https://github.com/peter-evans/create-pull-request/issues/48 summarized in: https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs
Hence, we could implement one of the workarounds:
Workarounds to trigger further workflow runs
There are a number of workarounds with different pros and cons. The easiest being:
Use the default GITHUB_TOKEN and allow the action to create pull requests that have no checks enabled. Manually close pull requests and immediately reopen them. This will enable on: pull_request workflows to run and be added as checks. To prevent merging of pull requests without checks erroneously, use branch protection rules.
Cause:
Using GITHUB_TOKEN for workflow_runs doesn't trigger more workflow_runs:
When you use the repository's GITHUB_TOKEN to perform tasks, events triggered by the GITHUB_TOKEN will not create a new workflow run. This prevents you from accidentally creating recursive workflow runs. For example, if a workflow run pushes code using the repository's GITHUB_TOKEN, a new workflow will not run even when the repository contains a workflow configured to run when push events occur.
Solution:
Configure updatecli to use personal token to trigger these PRs. For example, the chimera-bot token in the following: https://github.com/kubewarden/helm-charts/blob/main/.github/workflows/update-charts.yml#L229-L247 and https://github.com/kubewarden/helm-charts/blob/main/.github/workflows/update-dependencies.yaml#L22-L23