Repository navigation
A way to set specific branches triggered on push (commit). #664
Description
Activity
I have implemented a way to process regex for the
branchoption ontrigger: commit. It was part of experiments with the merge queues on GitHub, so it is not yet documented and well tested.I would suggest trying:
- <<: *copr # Run on push to any branch. trigger: commit branch: '^(?!.*master)'
- changed the title
[-]A way to set specific branches triggered on push (cocmmit).[/-][+]A way to set specific branches triggered on push (commit).[/+]on Jun 5, 2023 Thanks for the suggestion. Why is it the
branch: '^(?!.*master)'rather thanbranch: '^(?!master)'?Checking the Python regular expression syntax
(?!...)at https://docs.python.org/3/library/re.html. If you trim the heading and tailing spaces of the value of thebranch. I think we can omit the^in the'^(?!master)'too.I experimented.
$ python3 --version Python 3.11.3 $ python3 ... >>> import re >>> p = re.compile('^(?!master)') >>> print(p.match('master')) None >>> print(p.match(' master')) <re.Match object; span=(0, 0), match=''> >>> print(p.match('amaster')) <re.Match object; span=(0, 0), match=''> >>> print(p.match('mastera')) None>>> import re >>> p = re.compile('(?!master)') >>> print(p.match('master')) None >>> print(p.match('amaster')) <re.Match object; span=(0, 0), match=''> >>> print(p.match(' master')) <re.Match object; span=(0, 0), match=''> >>> print(p.match('mastera')) None >>> print(p.match('master ')) NoneIt seems I was able to run the CI on the push on a branch (
wip/packit-copr-push).
https://dashboard.packit.dev/results/copr-builds/810710+ branch: '(?!master)'Reacted by Matej FockoThanks for letting me know, I'll transfer it to the repo with docs, so it can be properly documented.
ad the suggested regex, it was just a guess :)
Okay. Thanks for implementing this!
- addedkind/documentationImprovements to docsImprovements to docsarea/generalNot tied to a specific areaNot tied to a specific areagain/lowDoesn't bring much value to usersDoesn't bring much value to usersimpact/lowAffects only few of the usersAffects only few of the users
on Jun 8, 2023 - addedcomplexity/single-taskRegular task; should be done within daysRegular task; should be done within daysand removed
on Jan 13, 2025 Still relevant.
Reacted by Michael R. Crusoe
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsbacklog
Description
I want to run Packit as a service on push for the specific branches. I want to trigger any branches except
masterbranch. Below is my current.packit.ymlconfiguration. Is there a way to do it? I check the https://dashboard.packit.dev/pipelines page. But it seems nothing triggers in the push for a branch with the following configuration. Does the currentbranch:syntax support the regular expression?Benefit
Users can test their commit by running on CI before sending the PR to the target repository.
Importance
GitHub Actions have the feature to set the triggered branches using the wildcard by
branchesandbranches-ignoresyntax.https://docs.github.com/en/actions/using-workflows/triggering-a-workflow#using-filters
https://docs.github.com/en/actions/using-workflows/triggering-a-workflow#example-excluding-branches
Workaround
Participation