{"id":15045790,"url":"https://github.com/jenkinsci/pipeline-gitstatuswrapper-plugin","last_synced_at":"2025-10-19T21:32:12.626Z","repository":{"id":41928245,"uuid":"179594364","full_name":"jenkinsci/pipeline-gitstatuswrapper-plugin","owner":"jenkinsci","description":null,"archived":false,"fork":false,"pushed_at":"2022-12-12T16:50:25.000Z","size":109,"stargazers_count":7,"open_issues_count":4,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-30T06:04:51.087Z","etag":null,"topics":["github","jenkins-pipeline"],"latest_commit_sha":null,"homepage":"https://plugins.jenkins.io/pipeline-gitstatuswrapper/","language":"Java","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jenkinsci.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-04-04T23:59:44.000Z","updated_at":"2023-10-17T18:54:45.000Z","dependencies_parsed_at":"2023-01-27T22:31:08.945Z","dependency_job_id":null,"html_url":"https://github.com/jenkinsci/pipeline-gitstatuswrapper-plugin","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenkinsci%2Fpipeline-gitstatuswrapper-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenkinsci%2Fpipeline-gitstatuswrapper-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenkinsci%2Fpipeline-gitstatuswrapper-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenkinsci%2Fpipeline-gitstatuswrapper-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jenkinsci","download_url":"https://codeload.github.com/jenkinsci/pipeline-gitstatuswrapper-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237221176,"owners_count":19274447,"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":["github","jenkins-pipeline"],"created_at":"2024-09-24T20:52:16.941Z","updated_at":"2025-10-19T21:32:07.297Z","avatar_url":"https://github.com/jenkinsci.png","language":"Java","readme":"# Pipeline Git Status Wrapper Plugin\n[![Build Status](https://ci.jenkins.io/job/Plugins/job/pipeline-gitstatuswrapper-plugin/job/master/badge/icon)](https://ci.jenkins.io/job/Plugins/job/pipeline-gitstatuswrapper-plugin/job/master/)\n\nThis plugin lets you wrap a block of commands with `gitStatusWrapper`, which handles updating GitHub statuses automatically!\n\n✅ gitStatusWrapper makes your life easier! ✅\n```\nstage('EZPZ Updates') {\n    steps {\n        gitStatusWrapper(credentialsId: 'github-token', gitHubContext: 'Status', description: 'Validating') {\n            sh \"./do_stuff.sh\"\n        }\n    }\n}\n```\n\n💀🚫 Stop calling githubNotify 3+ times 🚫💀\n```\nstage('Annoying status updates') {\n    script {\n      try {\n        githubNotify(credentialsId: 'github-token', context: 'Status', description: 'Validating', status: 'PENDING')\n        sh \"./do_stuff.sh\"\n        githubNotify(credentialsId: 'github-token', context: 'Status', description: 'Validating', status: 'SUCCESS')\n      }\n      catch (Exception e) {\n        githubNotify(credentialsId: 'github-token', gitHubContext: 'Status', description: 'Validating', status: 'FAILURE')\n      }\n    }\n}\n```\n\n\nThe available parameters are:\n\n| Parameter       | Description  |\n| -------------   |:-------------|\n| _credentialsId_        | The id of the github's credentials to use, must be of type UsernameAndPassword and contain the password or a personal access token. |\n| _description_          | A short description for the status |\n| _gitHubContext_        | The status context. GitHub uses the context to differentiate statuses |\n| _sha_                  | The sha that identifies the commit to set the status on |\n| _repo_                 | The repo that owns the commit we want to set the status on |\n| _account_              | The account that owns the repository |\n| _gitApiUrl_            | GitHub Enterprise instance API URL |\n| _targetUrl_            | The targetUrl for the notification|\n| _successDescription_   | A short description for the status if wrapped steps succeed _Can be Regex_ |\n| _failureDescription_   | A short description for the status if wrapped steps fail. _Can be Regex_ |\n\n\n\n# Inferring parameter values and defaults\n\n## Inferring\nInstead of specify all your parameters, this step will try to infer some of them if they\nare not provided. The parameters that can be inferred are:\n\n| Parameter       |\n| -------------   |\n| _credentialsId_ |\n| _sha_           |\n| _repo_          |\n| _account_       |\n\n*Note that infer will only work if you have Git Build Data. If you find problems when inferring, specify the\nrequired data explicitly. (You can access this data on your Jenkinsfile by using the appropriate env variables)*\n\n## Defaults\nThe plugin will default some parameters as a convenience. The following are defaults:\n\n| Parameter       | Default |\n| -------------   |:--------|\n| _gitApiUrl_     | `https://api.github.com` |\n| _gitHubContext_ | \"gitStatusWrapper\" |\n| _targetUrl_     | The jenkins project build URL |\n| _description_   | \"\" |\n\n# Regex descriptions\n_Since 1.1.0_\n\nYou can now specify a regex pattern for the *successDescription* and *failureDescription* parameters. This regex will be used to match against the entire build log.\nIt will use the first group match as the description for the respective status message.\n\nTo enable, wrap your regex with '`/`' to have it evaluted as regex.\n\nExample:\n```\ngitStatusWrapper(credentialsId: 'github-token', description: 'Pending description', gitHubContext: 'jenkins/appTests', \n                successDescription='/^buildVersion=(.*)$/') {\n   sh '''\n   echo \"buildVersion=$(./my_script.sh)\"\n   '''\n}\n```\n\n# Examples\n\n## Explicit settings\nJenkinsfile:\n```\npipeline {\n    agent any\n    stages {\n        stage('Run tests') {\n            steps {\n                gitStatusWrapper(credentialsId: 'github-token', description: 'Running Tests', gitHubContext: 'jenkins/appTests', \n                sha: 'ffg2ab', repo: 'my-repo', account: 'myaccount', gitApiUrl: 'https://[github.mycorp.com]/api/', \n                targetUrl: 'https://[myTestingSite].me') {\n                    sh \"./get_test_data.sh\"\n                    sh \"./run_my_tests.sh\"\n                }\n            }\n        }\n    }\n}\n```\nOutput:\n```\n...\n[Pipeline] gitStatusWrapper\n[GitStatusWrapper] - Setting PENDING status for jenkins/appTests on commit ffg2ab130985981ac0735f9789e19750f7200bd6\n[Pipeline] {\n[Pipeline] sh\n+ ./get_test_data.sh\nsuccess\n[Pipeline] sh\n+ ./run_my_tests.sh\nok\nok\nok\n[Pipeline] }\n[GitStatusWrapper] - Setting SUCCESS status for jenkins/appTests on commit ffg2ab130985981ac0735f9789e19750f7200bd6\n...\n```\n\n\n## Inferring properties and default values\n\nPipeline job with `Jenkinsfile from SCM`\n```\npipeline {\n    agent any\n    stages {\n        stage('Run tests') {\n            steps {\n                gitStatusWrapper(credentialsId: 'github-token') {\n                    sh \"./get_test_data.sh\"\n                    sh \"./run_my_tests.sh\"\n                }\n            }\n        }\n    }\n}\n```\nOutput:\n```\n...\n[Pipeline] gitStatusWrapper\n[GitStatusWrapper] - Setting PENDING status for gitStatusWrapper on commit ffg2ab130985981ac0735f9789e19750f7200bd6\n[Pipeline] {\n[Pipeline] sh\n+ ./get_test_data.sh\nsuccess\n[Pipeline] sh\n+ ./run_my_tests.sh\nok\nok\nok\n[Pipeline] }\n[GitStatusWrapper] - Setting SUCCESS status for gitStatusWrapper on commit ffg2ab130985981ac0735f9789e19750f7200bd6\n...\n```\n\n## Example of failure\nPipeline job with `Jenkinsfile from SCM`\n```\npipeline {\n    agent any\n    stages {\n        stage('Run tests') {\n            steps {\n                gitStatusWrapper(credentialsId: 'github-token') {\n                    sh \"./get_test_data.sh\"\n                    sh \"./run_my_tests.sh\"\n                }\n            }\n        }\n    }\n}\n```\nOutput:\n```\n...\n[Pipeline] gitStatusWrapper\n[GitStatusWrapper] - Setting PENDING status for gitStatusWrapper on commit ffg2ab130985981ac0735f9789e19750f7200bd6\n[Pipeline] {\n[Pipeline] sh\n+ ./get_test_data.sh\nsuccess\n[Pipeline] sh\n+ ./run_my_tests.sh\nok\nok\n! failure com.project.TestCalcs.java !\n[Pipeline] }\n[GitStatusWrapper] - Setting Failure status for gitStatusWrapper on commit ffg2ab130985981ac0735f9789e19750f7200bd6\n...\n```\n\n# No pipeline? No Problem\nThis plugin also includes a builder plugin, so you can wrap your freestyle projects with the same goodness as the pipeline version.\n\n\u003cimg src=\"src/main/webapp/img/builder_example.png\"/\u003e\n\n## Users\n\nUse the plugin? Let us know to get your logo here!\n\n\u003cdiv\u003e\n    \u003cp\u003e---------Created and Used by---------\u003c/p\u003e\n    \u003ca href=\"http://opensource.intuit.com/\"\u003e\u003cimg width=\"225\" height=\"110\" src=\"src/main/webapp/img/Intuit_user.png\"/\u003e\u003c/a\u003e\n    \u003cp\u003e---------------------------------------\u003c/p\u003e\n\u003c/div\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjenkinsci%2Fpipeline-gitstatuswrapper-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjenkinsci%2Fpipeline-gitstatuswrapper-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjenkinsci%2Fpipeline-gitstatuswrapper-plugin/lists"}