{"id":28194247,"url":"https://github.com/monkey-projects/plugin-github","last_synced_at":"2026-02-04T07:38:08.029Z","repository":{"id":246844252,"uuid":"824056025","full_name":"monkey-projects/plugin-github","owner":"monkey-projects","description":"MonkeyCI plugin to access Github api","archived":false,"fork":false,"pushed_at":"2024-12-13T13:43:34.000Z","size":29,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-21T16:53:05.117Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Clojure","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/monkey-projects.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2024-07-04T09:21:02.000Z","updated_at":"2024-12-13T13:43:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"31e9072f-15f5-4e51-b811-f4710edff781","html_url":"https://github.com/monkey-projects/plugin-github","commit_stats":null,"previous_names":["monkey-projects/plugin-github"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monkey-projects%2Fplugin-github","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monkey-projects%2Fplugin-github/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monkey-projects%2Fplugin-github/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monkey-projects%2Fplugin-github/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/monkey-projects","download_url":"https://codeload.github.com/monkey-projects/plugin-github/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254535800,"owners_count":22087399,"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":"2025-05-16T13:11:42.826Z","updated_at":"2026-02-04T07:38:08.024Z","avatar_url":"https://github.com/monkey-projects.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MonkeyCI Github Plugin\n\nThis is a Clojure lib that provides functions to interact with the Github\nAPI from a [MonkeyCI](https://monkeyci.com) build.\n\n## Usage\n\nIn your `.monkeyci` directory, add the dependency to your `deps.edn`:\n```clojure\n{:deps {com.monkeyci/plugin-github {:mvn/version \"0.1.0-SNAPSHOT\"}}}\n```\n\nThen, in your `build.clj`, require the namespace, and then you can add one\nof the provided build jobs:\n```clojure\n(require '[monkey.ci.plugin.github :as gh])\n```\n\n## Provided Jobs\n\nThe jobs currently provided are these:\n\n### release-job\n\nCreates a release according to the current build settings.  This job will\nonly be executed if the build is triggered from a tag.  It will use the\ntag name as release name, formatted using the configured format string.\n\n```clojure\n;; Job that will create a release in Github for the commit tag,\n;; formatting the tag by prefixing it with a `v`.\n(gh/release-job {:name-format \"v%s\"})\n```\n\nThis job in turn invokes the `create-release!` function in Github.  This call\nrequires some sort of authentication to the Github API, for which it will\nautomatically fetch the `github-token` build parameter, or you can provide your\nown `:token` in the job configuration.  If no token is provided, the job will\nfail.\n\nThe jobs usually run inside the build script itself, so they don't need\nto start a new container, and are very fast.\n\nThe `release-job` function accepts these options:\n|Option|Default|Meaning|\n|---|---|---|\n|`name-format`|`v%s`|How the release name is formatted using the tag name|\n|`dependencies`||Optional dependencies for the job|\n|`org`|Build org|The organisation to use when calling Github.  Defaults to the organisation extracted from the repository url.|\n|`repo`|Build repo|The repository to create the release on.  Defaults to the configured MonkeyCI repo.|\n|`desc`||Optional description for the release|\n|`token`|`github-token` param or `GITHUB_TOKEN` env|The token to use to authenticate to Github.|\n\n### patch-job\n\nThe `patch-job` can be used to patch one or more files in another Github repo.  You're free\nto patch files in the same repo, but this can lead to an infinite build loop.  Patching files\ncan be useful when you have an *infrastructure as code* system and you want to auto-deploy a\ncontainer image that you just built.\n\n```clojure\n;; Patch a single file\n(gh/patch-job {:org \"my-org\"\n               :repo \"my-repo\"\n\t       :branch \"main\"\n\t       :path \"path/to/file\"\n\t       :patcher (fn [txt]\n\t                  \"this is the new file contents\")\n\t       :commit-msg \"File updated by build\"})\n\n;; Patch a multiple files\n(gh/patch-job {:org \"my-org\"\n               :repo \"my-repo\"\n\t       :branch \"main\"\n\t       :patches\n\t       [{:path \"path/to/file\"\n\t         :patcher (fn [txt]\n\t                    \"this is the new file contents\")}\n                {:path \"path/to/other/file\"\n\t         :patcher (fn [txt]\n\t                    \"this is another file contents\")}]\n\t       :commit-msg \"Files updated by build\"})\n```\n\nThe `patch-job` function accepts these options:\n|Option|Default|Meaning|\n|---|---|---|\n|`path`||The path to the file to patch (overrides `patches` below)|\n|`patcher`||The 1-arity function that receives the original file contents and returns the new contents|\n|`patches`||List of patches, each containing a `path` and `patcher`|\n|`dependencies`||Optional dependencies for the job|\n|`org`|Build org|The organisation to use when calling Github.  Defaults to the organisation extracted from the repository url.|\n|`repo`|Build repo|The repository to create the release on.  Defaults to the configured MonkeyCI repo.|\n|`commit-msg`||The commit message to use|\n|`token`|`github-token` param or `GITHUB_TOKEN` env|The token to use to authenticate to Github.|\n|`job-id`|`patch`|The id of the job|\n\n## TODO\n\n - As soon as MonkeyCI supports it, we should allow invoking the MonkeyCI API to create the release.\n - Allow using app config (client id and secret) to authenticate to Github.\n\n## License\n\nCopyright (c) 2024-2025 by [Monkey Projects](https://www.monkey-projects.be)\n\n[MIT License](LICENSE)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonkey-projects%2Fplugin-github","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmonkey-projects%2Fplugin-github","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonkey-projects%2Fplugin-github/lists"}