{"id":19657754,"url":"https://github.com/esss/jenkins-to-github-notify","last_synced_at":"2025-04-28T19:32:25.098Z","repository":{"id":147478343,"uuid":"516378103","full_name":"ESSS/jenkins-to-github-notify","owner":"ESSS","description":"Notify build status using a Jenkins Webhook","archived":true,"fork":false,"pushed_at":"2023-11-14T16:44:01.000Z","size":36,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-02-27T02:29:48.619Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"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/ESSS.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.rst","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-07-21T13:15:13.000Z","updated_at":"2024-05-28T13:30:36.000Z","dependencies_parsed_at":"2024-11-11T15:48:49.721Z","dependency_job_id":null,"html_url":"https://github.com/ESSS/jenkins-to-github-notify","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ESSS%2Fjenkins-to-github-notify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ESSS%2Fjenkins-to-github-notify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ESSS%2Fjenkins-to-github-notify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ESSS%2Fjenkins-to-github-notify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ESSS","download_url":"https://codeload.github.com/ESSS/jenkins-to-github-notify/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251375515,"owners_count":21579460,"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":[],"created_at":"2024-11-11T15:33:35.559Z","updated_at":"2025-04-28T19:32:24.814Z","avatar_url":"https://github.com/ESSS.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"========================\njenkins-to-github-notify\n========================\n\nNotify build status using a Jenkins Webhook.\n\nThis service receives events posted by Jenkins WebHooks and updates `GitHub commit status API \u003chttps://docs.github.com/en/rest/commits/statuses\u003e`_.\n\n\nInstallation\n============\n\nThis repository contains a ``Dockerfile`` which can be used to build an image, which can then be run in any server.\n\nService configuration\n---------------------\n\nPlace a ``.env`` file in the current working directory where the service is started::\n\n    JENKINS_URL=https://some-server.com/jenkins\n    JENKINS_USERNAME=jenkins-bot\n    JENKINS_PASSWORD=PASSWORD_FOR_JENKINS_BOT\n    JENKINS_SECRET=GENERATED_SECRET\n\n    GH_TOKEN=GITHUB_TOKEN\n\n\n* ``JENKINS_URL``: full URL to the Jenkins server.\n* ``JENKINS_USERNAME``: user name to access the Jenkins API.\n* ``JENKINS_PASSWORD``: password or token for ``JENKINS_USERNAME``. Prefer tokens when possible as they can be easily revoked and has less permissions.\n* ``JENKINS_SECRET``: this is a secret that will be sent by the Web Hook and verified by the service to ensure the requests are coming from the expected place.\n\n  Can be generated easily with:\n\n  .. code-block:: python\n\n     \u003e\u003e\u003e import secrets\n     \u003e\u003e\u003e secrets.token_hex()\n     'GENERATED TOKEN'\n\n  This same secret will be used in the Jenkins configuration below.\n\n* ``GH_TOKEN``: a `personal access token \u003chttps://github.com/settings/tokens/\u003e`__ with ``repo`` permissions to the repositories that will have their status updated.\n\n\nJenkins configuration\n---------------------\n\nGo to *Configure System*, and enter a new *Web Hook*:\n\n* Enter the address/port where the container is running.\n* Enter a timeout (30s is fine).\n* Click *Advanced*, uncheck *All Events*, and mark:\n\n  - ``jenkins.job.started``\n  - ``jenkins.job.completed``\n\n  For both of them, *customize* the URL with::\n\n    ${url}?event=${event.name}\u0026build_number=${run.number}\u0026job_name=${run.project.name}\u0026url=${run.getUrl()}\u0026secret=JENKINS_SECRET\n\n  Replace ``JENKINS_SECRET`` with the value of the ``JENKINS_SECRET`` variable.\n\n\nDevelopment\n===========\n\nCreate a virtual environment for Python 3.10, activate it, then execute:\n\n\n.. code-block:: console\n\n    pip install pip-tools\n    pip-sync\n    pre-commit install\n\n\nTo run the tests:\n\n.. code-block:: console\n\n    pytest\n\nDeployment\n==========\n\nThere is a ``deploy`` workflow which is `triggered manually \u003chttps://github.com/ESSS/jenkins-to-github-notify/actions/workflows/deploy.yml\u003e`__.\n\nThe inputs are:\n\n* ``version``: the ref version to push, usually a tag.\n* ``push``: if we should push the build image to the configured docker registry or not.\n\nThis workflow uses these organization/repository secrets:\n\n* ``docker_registry``: the URL of the docker registry used to login.\n* ``docker_registry_push_url``: the URL where we should push images to.\n* ``docker_push_user``: user name with has push access to the registry.\n* ``docker_push_password``: password of the user.\n\nSimilar projects\n================\n\nThere are Jenkins plugins which do something similar, but did not met all our requirements:\n\n* `GitHub plugin \u003chttps://plugins.jenkins.io/github/\u003e`_: also reports build status, however it does not work\n  for multiple repositories (see `JENKINS-28177 \u003chttps://issues.jenkins.io/browse/JENKINS-28177\u003e`_).\n* `GitHub Checks plugin \u003chttps://plugins.jenkins.io/github-checks/\u003e`_: unfortunately requires a more complex setup requiring\n  a GitHub App for authentication, and seems (but not 100% sure) to require setting up a special \"github project\"\n  in Jenkins (instead of a normal Git repository).\n\n\nLicense\n=======\n\nMIT.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fesss%2Fjenkins-to-github-notify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fesss%2Fjenkins-to-github-notify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fesss%2Fjenkins-to-github-notify/lists"}