At decidim/decidim we’re using GitHub Actions to run the test suite on every push in every PR, and on every push in specific branches. So far it’s working fine.
We’re using Crowdin to handle translations for our application. Crowdin requires access to our repo, and creates a PR with a specific prefix. We set this prefix to
chore/l10n_, so we consider any PR coming from a branch matching this prefix to be coming from Crowdin, and thus we want to skip the test suite for those PRs. Again, our current setup so far is working fine, but it’s adding a lot of jobs to our queue that we know they won’t run and we want to totally ignore them.
Here’s our first attempt at it:
name: "CI" on: push: branches: - develop - release/* - "*-stable" pull_request: branches-ignore: - "chore/l10n*"
But this doesn’t seem to be working, as PRs matching the branch name have the jobs enqueued (but skipped later thanks to a check on the job).
I’ve tried different approaches:
- Using the
**character instead of a single
pull_request: branches-ignore: - "chore/l10n**"
- Using a negative filter on
pull_request: branches: - "!chore/l10n**"
- Manually specifying the branches to ignore:
pull_request: branches: - "**" - "!chore/fix-ci-ignores-for-crowdin" - "!chore/l10n**"
None of these did what I expected to do. You can see my attempts in Fix pattern mathing when ignoring branches in CI by mrcasals · Pull Request #7570 · decidim/decidim · GitHub
I’d like to have some workflows run for all pushes in specific branches and for all PRs except for those PRs matching a specific branch name pattern.
How can I get this working?