I would like to update how the push event for our GitHub Actions workflow
is configured.
Currently, we have the following:
```
on:
push:
branches-ignore:
- 'dependabot/**'
```
This prevents the workflow from executing when commits are pushed to
branches prefixed with dependabot, which is correct, but does not exclude
other development branches.
I was looking into this configuration because PRs show duplicate checks
(one for push and one for PR). This is noticeable for those who create
branches upstream, instead of creating on a forked repo.
I was wondering if we could modify to the following:
```
on:
push:
branches:
- 'master'
- '[0-9]+-[0-9]+-x'
```
Instead of configuring which branches to ignore, we would define which
branches should run.
I was wondering if this could be avoided somehow, if it is related to this
push event, the overall desired behavior, and if we should recommend using
forked repos for development work only instead.
Does anyone have any concerns or reasons if this change is undesirable
compared with the current configuration? Or have any opinion about the
desired behavior or development workflow?
If I understand the documentation correctly, I believe this configuration
should work and only run when commits are pushed to the master branch or
matching a release branch.
I would need to test and confirm the behavior before making any changes,
but I have seen similar configurations in other projects and wanted to
raise this.
References:
-
https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#onpushbranchestagsbranches-ignoretags-ignore