-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expression-based job filters #9046
Conversation
|
||
**Examples** | ||
|
||
Allow the job to run only on the project's `main` branch: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
~ What do you think about
Only run the job on the project's
main
branch:
I feel we should avoid using words like "allow" or "deny" because they imply a permission control but since anybody can modify the filters for commits the push on an unprotected branch they can always make the job run if they want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yeah agreed. This language is there due to being copied over from context restrictions 🙈
@@ -1761,7 +1761,7 @@ While this improves performance in most cases, if a downstream step requires tho | |||
---- | |||
==== | |||
|
|||
A special step used to check out source code to the configured `path` (defaults to the `working_directory`). The reason this is a special step is because it is more of a helper function designed to make checking out code easy for you. If you require doing git over HTTPS you should not use this step as it configures git to checkout over SSH. | |||
A special step used to check out source code to the configured `path` (defaults to the `working_directory`). The reason this is a special step is because it is more of a helper function designed simplify the process of checking out code. If you require doing git over HTTPS you should not use this step as it configures git to checkout over SSH. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
~ missing "to", i.e. designed to simplify
?
@@ -2713,10 +2718,10 @@ NOTE: Workflows will ignore job-level branching. If you use job-level branching | |||
| `filters` | |||
| N | |||
| Map | |||
| A map defining rules for execution on specific branches | |||
| A map defining rules for execution on specific branches, tags, or based on an expression-based condition. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
filters
is now either a map, or a string. If it's a string then it's an expression filter, otherwise it's the older branches
/tags
structure.
---- | ||
|
||
The above snippet causes the job `build_server_pdfs` to only be run when the branch being built starts with "server/". | ||
Only run the job on the `main` branch, and disallow use with pipelines xref:vs-code-extension-overview#test-run-your-config-from-vs-code[triggered with unversioned configuration]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about
Only run the job on the
main
branch, but not if the pipeline was triggered with unversioned configuration
?
Description
Reasons
Expression-based job filters now available
Content Checklist
Please follow our style when contributing to CircleCI docs. Our style guide is here: https://circleci.com/docs/style/style-guide-overview.
Please take a moment to check through the following items when submitting your PR (this is just a guide so will not be relevant for all PRs) 😸: