{"id":21980003,"url":"https://github.com/jenkinsci/run-condition-plugin","last_synced_at":"2025-04-30T04:35:08.962Z","repository":{"id":1801632,"uuid":"2725631","full_name":"jenkinsci/run-condition-plugin","owner":"jenkinsci","description":"Allow plugins to define new run conditions that decide whether to run a build step","archived":false,"fork":false,"pushed_at":"2025-03-01T16:08:05.000Z","size":348,"stargazers_count":9,"open_issues_count":2,"forks_count":30,"subscribers_count":96,"default_branch":"master","last_synced_at":"2025-03-30T12:33:57.551Z","etag":null,"topics":["adopt-this-plugin"],"latest_commit_sha":null,"homepage":"https://plugins.jenkins.io/run-condition/","language":"Java","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"bap2000/jenkins-run-condition-plugin","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jenkinsci.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG-old.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2011-11-07T11:20:51.000Z","updated_at":"2025-03-01T16:08:08.000Z","dependencies_parsed_at":"2024-05-01T16:32:37.974Z","dependency_job_id":"7338b963-5952-4d08-8dde-13c0f5a86fcb","html_url":"https://github.com/jenkinsci/run-condition-plugin","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenkinsci%2Frun-condition-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenkinsci%2Frun-condition-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenkinsci%2Frun-condition-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenkinsci%2Frun-condition-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jenkinsci","download_url":"https://codeload.github.com/jenkinsci/run-condition-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251644262,"owners_count":21620617,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["adopt-this-plugin"],"created_at":"2024-11-29T17:09:01.858Z","updated_at":"2025-04-30T04:35:08.936Z","avatar_url":"https://github.com/jenkinsci.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Run condition plugin\n\n## Features\n\nThis plugin defines an ExtensionPoint that can be used by plugins to\ndefine new Run Conditions and to use Run Conditions to decide whether to\nrun a build step.\n\nThis plugin defines a few core Run Conditions:\n\n-   **Always / Never**  \n    The always and Never conditions can be used to disable a build step\n    from the job configuration without losing the current configuration\n    for that build step\n-   **Boolean condition**  \n    Run the step if a token expands to a representation of true (or the\n    string \"run\")\n-   **Current status**  \n    Run the build step if the current build status is within the\n    configured range\n-   **File exists / Files match**  \n    Run the step if a file exists, or at least one file matches a\n    pattern.\n-   **Strings match**  \n    Run if the two strings are the same\n-   **Numerical comparison**  \n    Run the build step depending on the result of comparing two numbers.\n    Very useful with tokens\n    provided by the \"Static Code Analysis\n    Plug-ins\" that were integrated into the [Warnings Next Generation](https://plugins.jenkins.io/warnings-ng)\n-   **Regular expression match**  \n    Provide a regular expression and a label. The build step will run if\n    the expression matches the label. Both the expression and the label\n    are expanded with the [Token Macro\n    Plugin](https://plugins.jenkins.io/token-macro/)\n    enabling a dynamic (parameterized) regex, label or both.\n-   **Time / Day of week**  \n    Only run during a specified period of the day, or day of the week.\n-   **And / Or / Not**  \n    Logical operations to enable the combining and sense inversion of\n    Run Conditions\n-   **Build Cause**  \n    Run the build step depending on the cause of the build e.g.\n    triggered by timer, user, scm-change,...\n-   **Script Condition**  \n    Use shell script to decide whether a step should be skipped\n-   **Windows Batch Condition**  \n    Use windows batch to decide whether a step should be skipped \n\n#### Run Conditions are currently used in the following plugins\n\n-   [Build Keeper\n    Plugin](https://plugins.jenkins.io/build-keeper-plugin/)\n    —\n    Select a policy for automatically marking builds as \"keep forever\"\n    to enable long term analysis trending when discarding old builds -\n    or use to protect logs and artifacts from certain builds\n-   [Conditional BuildStep\n    Plugin](https://plugins.jenkins.io/conditional-buildstep/)\n    — A buildstep wrapping any number of other buildsteps, controlling\n    their execution based on a defined condition.\n-   [Run Condition Extras\n    Plugin](https://plugins.jenkins.io/run-condition-extras/)\n    —\n    This plugin provides additional run conditions and integrations for\n    [Run Condition\n    Plugin](https://plugins.jenkins.io/run-condition/)\n\n## Install\n\nThis plugin is used by other plugins and will be installed automatically\nwhen one of those is installed from the Update Center.\n\nTo install manually, download the latest plugin from\n\u003chttp://mirrors.jenkins-ci.org/plugins/run-condition/\u003e and use the\nUpload Plugin option in the Advanced tab of the Plugin Manager.  \nIf you do install manually, you will need to also install the [Token\nMacro\nPlugin](https://plugins.jenkins.io/token-macro/)\nfrom \u003chttp://mirrors.jenkins-ci.org/plugins/token-macro/\u003e.\n\n## Examples\n\n#### Example: Control execution by a string parameter\n\n... this one gets executed if 'SOME\\_ENV' (any environment variable)\nmatches the string 'MyEnvValue'. As any build parameter gets exposed as\nan environment variable, the value can be controlled by a parameter.\n\n![Control execution by a string parameter](docs/images/screen-capture-3.jpg)\n\n#### Example: Run a build step if a file **does not** exist\n\nUse the logical **Not** condition, and inside, select **File exists**\n\n![Run a build step if a file does not exist](docs/images/not-file-exists.png)\n\n#### Example: Use a parameterised build to select which publishers to run\n\nI.e. Set string parameter on a parameterized build to ^(UAT\\|DEMO)$ to\nrun all steps that are labeled with either DEMO or UAT\n\n![Use a parameterised build to select which publishers to run](docs/images/param-publish.png)\n\n#### Example: Only publish junit reports if we have some result files\n\n![Only publish junit reports if we have some result files](docs/images/pub-junit.png)\n\n#### Example: Only sound the sirens during work hours\n\nAdd an **And** condition and then add **Time** and **Day of week**\nconditions to it\n\n![Only sound the sirens during work hours](docs/images/work-hours.png)\n\n## How to contribute a RunCondition to the Run Condition Plugin\n\nThis plugin provides an ExtensionPoint which enables other plugins to\nprovide new Run Conditions to plugins that use them.  \nThere is an [example plugin](https://github.com/bap2000/jenkins-run-condition-example-plugin) on GitHub.\n![run-cond-eg-help](docs/images/run-cond-eg-help.png)  \n[This](src/main/java/org/jenkins_ci/plugins/run_condition/RunCondition.java) is the RunCondition ExtensionPoint.  \n[This one file](https://github.com/bap2000/jenkins-run-condition-example-plugin/blob/master/src/main/java/org/jenkins_ci/plugins/run_condition/example/ExampleCondition.java) contains **all** of the java code in the Example plugin.  \nAnd [this](https://github.com/bap2000/jenkins-run-condition-example-plugin/blob/master/src/main/resources/org/jenkins_ci/plugins/run_condition/example/ExampleCondition/config.jelly) is the XML for the view\n\n## Changelog\nFor recent versions, see [GitHub Releases](https://github.com/jenkinsci/run-condition-plugin/releases)  \nFor versions 1.0 and older, see the [CHANGELOG.md](CHANGELOG.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjenkinsci%2Frun-condition-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjenkinsci%2Frun-condition-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjenkinsci%2Frun-condition-plugin/lists"}