Skip to content

Document commit-trigger branch regexes and fork-safe Copr builds - #1182

Open
Nitjsefnie wants to merge 2 commits into
packit:mainfrom
Nitjsefnie-OSC:docs/664-branch-regex-fork-builds
Open

Nitjsefnie wants to merge 2 commits into
packit:mainfrom
Nitjsefnie-OSC:docs/664-branch-regex-fork-builds

Conversation

@Nitjsefnie

Copy link
Copy Markdown
Contributor

Summary

Document that the branch option of a trigger: commit Packit job accepts a Python regular expression — matching uses re.match, anchored at the start of the branch name (^ unnecessary) and not required to consume the whole name, so branch: main also matches main-fix and main/probe — and add a worked example for getting Copr builds from a fork when the upstream config pins an explicit Copr owner/project: a second job without owner/project (Packit's default project naming works from a fork) with a distinct identifier, restricted to non-default branches via a branch regex.

Related Issues and Pull Requests

Fixes #664
Fixes #631

Changes

  • docs/configuration/upstream/copr_build.md: the branch bullet now documents regex support with the exact matching semantics (start-anchored re.match, partial match allowed), a plain-name example and its exact-name variant (main$), and a worked "every branch except the default" pattern ^(?!main$).*.
  • docs/configuration/examples.md: new "Running Copr builds from a fork without changing the upstream project" example — keep the upstream job with explicit owner/project, add a second job without them (default Copr naming), give both jobs distinct identifier values, and split them with complementary main$ / ^(?!main$).* branch filters; notes the regex-metacharacter escaping caveat for other default branch names and the remaining permission limitation for pushes to the fork's main.

Testing

Docs-only change; no runtime behavior changed. The example YAML parses (yaml.safe_load), and the documented matching semantics were verified against packit-service's matching source (packit_service/worker/helpers/build/build_helper.py uses re.match) and probed with Python. Fork CI green on the branch head a07a67f: osc-manual.yml run 39836032954 on the fork, 1 job green, provenance echo naming that SHA.

Footer

Generated by GLM-5.3-Flash (brief, orchestration), GPT-6.1 Sol (implementation), GPT-6 Astra (review)

Nitjsefnie and others added 2 commits October 22, 2026 20:47
Co-Authored-By: GPT-6.1 Sol <noreply@openai.com>
Signed-off-by: Nitjsefnie <zmatek.peter@gmail.com>
Co-Authored-By: GPT-6.1 Sol <noreply@openai.com>
Signed-off-by: Nitjsefnie <zmatek.peter@gmail.com>
@centosinfra-prod-github-app

Copy link
Copy Markdown
Contributor

@Nitjsefnie

Copy link
Copy Markdown
Contributor Author

Heads-up: this branch lives in an organization-owned fork, and GitHub doesn't let maintainers push to those. If anything needs changing, just say so here and I'll make the change on this branch right away.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

A way to set specific branches triggered on push (commit). Running packit as a service for forks

2 participants