{"id":13595806,"url":"https://github.com/mislav/bump-homebrew-formula-action","last_synced_at":"2025-05-14T16:14:57.514Z","repository":{"id":38102357,"uuid":"215108366","full_name":"mislav/bump-homebrew-formula-action","owner":"mislav","description":"Automatically bump Homebrew formula after a release","archived":false,"fork":false,"pushed_at":"2025-04-09T19:27:41.000Z","size":2773,"stargazers_count":180,"open_issues_count":3,"forks_count":36,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-04-10T15:55:29.214Z","etag":null,"topics":["actions","github-action","github-actions","homebrew","release-management"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mislav.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":"2019-10-14T17:44:22.000Z","updated_at":"2025-04-09T19:27:42.000Z","dependencies_parsed_at":"2023-10-11T11:08:26.866Z","dependency_job_id":"975a75dc-6d9d-42c7-94e0-117308126ff2","html_url":"https://github.com/mislav/bump-homebrew-formula-action","commit_stats":{"total_commits":165,"total_committers":13,"mean_commits":"12.692307692307692","dds":0.5272727272727273,"last_synced_commit":"60f60fa7a3958e068921dd4002e87010157f4b0d"},"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mislav%2Fbump-homebrew-formula-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mislav%2Fbump-homebrew-formula-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mislav%2Fbump-homebrew-formula-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mislav%2Fbump-homebrew-formula-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mislav","download_url":"https://codeload.github.com/mislav/bump-homebrew-formula-action/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248677751,"owners_count":21144176,"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":["actions","github-action","github-actions","homebrew","release-management"],"created_at":"2024-08-01T16:01:58.055Z","updated_at":"2025-04-13T13:56:00.694Z","avatar_url":"https://github.com/mislav.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"A minimal GitHub action that uses the GitHub API to bump a Homebrew formula\nafter a new release in your repository.\n\nUsage example:\n\n```yml\non:\n  push:\n    tags: 'v*'\n\njobs:\n  homebrew:\n    name: Bump Homebrew formula\n    runs-on: ubuntu-latest\n    steps:\n      - uses: mislav/bump-homebrew-formula-action@v3\n        with:\n          # By default, this will edit the `my_formula.rb` formula in\n          # homebrew-core to update its \"url\" field to:\n          # `https://github.com/OWNER/REPO/archive/refs/tags/\u003ctag-name\u003e.tar.gz`\n          # The \"sha256\" formula field will get automatically recomputed.\n          formula-name: my_formula\n        env:\n          # the personal access token should have \"repo\" \u0026 \"workflow\" scopes\n          COMMITTER_TOKEN: ${{ secrets.COMMITTER_TOKEN }}\n```\n\nThe `COMMITTER_TOKEN` secret is required because this action will want to write\nto an external repository. You can [generate a new Personal Access Token (classic)\nhere](https://github.com/settings/tokens) and give it `repo` and `workflow` scopes.\n\n## How it works\n\nGiven a Homebrew formula `Formula/my_formula.rb` in the\n[homebrew-core](https://github.com/Homebrew/homebrew-core) repo:\n\n```rb\nclass MyFormula \u003c Formula\n  url \"https://github.com/me/myproject/archive/refs/tags/v1.2.3.tar.gz\"\n  sha256 \"\u003cOLDSHA\u003e\"\n  # ...\nend\n```\n\nAfter we push a `v2.0.0` git tag to a project that has this action configured,\nthe formula will be updated to:\n\n```rb\nclass MyFormula \u003c Formula\n  url \"https://github.com/me/myproject/archive/refs/tags/v2.0.0.tar.gz\"\n  sha256 \"\u003cNEWSHA\u003e\"\n  # ...\nend\n```\n\nThis action can update the following Homebrew formula fields:\n\n- `version`\n- `url`\n- `sha256` - for non-git `download-url` action input\n- `tag` - for git-based `download-url`\n- `revision` - for git-based `download-url`\n\n## Action inputs\n\nFormula parameters:\n\n- `formula-name`: the name of the Homebrew formula to bump. Defaults to\n  lower-cased repository name.\n\n- `formula-path`: the relative path of the Homebrew formula file to edit within the `homebrew-tap` repository. Defaults to\n  `Formula/\u003cletter\u003e/\u003cformula-name\u003e.rb` for homebrew-core formulae and `Formula/\u003cformula-name\u003e.rb` otherwise.\n\n- `tag-name`: the git tag name to bump the formula to. Defaults to the\n  currently pushed tag.\n\n- `download-url`: the package download URL for the Homebrew formula.\n\n  Defaults to `https://github.com/OWNER/REPO/archive/refs/tags/\u003ctag-name\u003e.tar.gz`, where `OWNER/REPO` is the repository that is running the Actions workflow.\n\n- `download-sha256`: the SHA256 checksum of the archive at `download-url`.\n  Defaults to calculating the checksum by fetching the archive at run time.\n\nRepository parameters:\n\n- `homebrew-tap`: the full GitHub repository name (in the `NAME/OWNER` format) where the Homebrew formula should be updated. Defaults\n  to `Homebrew/homebrew-core`.\n\n- `push-to`: a specific fork of `homebrew-tap` where the edit should be pushed to.\n  Defaults to creating or reusing a personal fork of the owner of COMMITTER_TOKEN.\n  (Note: avoid using an organization-owned fork, as that\n  [breaks automation for `homebrew-core`](https://github.com/foxglove/mcap/issues/1063)).\n\n- `base-branch`: the branch name in the `homebrew-tap` repository where the\n  formula should be updated. Defaults to the main branch of the repository.\n\n- `create-pullrequest`: a boolean value to either force or prohibit submitting\n  a pull request to `homebrew-tap`. Defaults to false if `COMMITTER_TOKEN` has\n  the privileges to directly push to `base-branch` in `homebrew-tap`.\n\n- `create-branch`: a boolean value to either force or prohibit creating a\n  branch on `homebrew-tap`. Defaults to false if `COMMITTER_TOKEN` has\n  the privileges to directly push to `base-branch` in `homebrew-tap`.\n  You cannot set this to `false` if `create-pullrequest` is set to `true`.\n\n- `commit-message`: the git commit message template to use when updating the\n  formula. The following placeholders be expanded:\n\n  | Placeholder       | Description                                        |\n  | ----------------- | -------------------------------------------------- |\n  | `{{formulaName}}` | the name of the formula supplied in `formula-name` |\n  | `{{version}}`     | the version number for this release                |\n\n  It's recommended that `commit-message` has _both subject and body_, i.e. that\n  it contains a subject line followed by a blank line followed by body text.\n  Otherwise, pull requests to `Homebrew/homebrew-core` might get denied by\n  their automation.\n\n  Defaults to:\n\n  ```\n  {{formulaName}} {{version}}\n\n  Created by https://github.com/mislav/bump-homebrew-formula-action\n  ```\n\n### Environment variables\n\n- `COMMITTER_TOKEN` (required): needs _write access_ to the repository specified\n  by the `homebrew-tap` input, or enough privileges to _fork the tap repo_\n  (usually `homebrew-core`) and submit a PR to it.\n\n  Recommended \"classic\" token scopes: `repo` \u0026 `workflow`.\n\n- `GITHUB_TOKEN` (optional): needs _read access_ to the contents of the\n  repository that is executing this action; will be used for verifying the\n  SHA256 checksum of the downloadable archive for this release. Useful only if\n  the repository that runs this Action is private _and_ if `COMMITTER_TOKEN` has\n  the `public_repo` scope only.\n\n## Examples\n\nComprehensive usage example:\n\n```yml\non:\n  push:\n    tags: 'v*'\n  # Alternatively, trigger this workflow after a stable release has been published:\n  #release:\n  #  types: [ released ]\n\njobs:\n  homebrew:\n    name: Bump Homebrew formula\n    # Skip this job in case of git pushes to prerelease tags\n    if: ${{ github.event_name != 'push' || !contains(github.ref, '-') }}\n    runs-on: ubuntu-latest\n    permissions:\n      contents: read\n    steps:\n      - name: Extract version\n        id: extract-version\n        # Strip a string prefix from the git tag name:\n        run: |\n          echo \"tag-name=${GITHUB_REF#refs/tags/}\" \u003e\u003e $GITHUB_OUTPUT\n\n      - uses: mislav/bump-homebrew-formula-action@v3\n        with:\n          formula-name: my_formula\n          formula-path: Formula/m/my_formula.rb\n          homebrew-tap: Homebrew/homebrew-core\n          base-branch: master\n          download-url: https://example.com/packages/myformula-${{ steps.extract-version.outputs.tag-name }}.tar.gz\n          commit-message: |\n            {{formulaName}} {{version}}\n\n            Created by https://github.com/mislav/bump-homebrew-formula-action\n        env:\n          COMMITTER_TOKEN: ${{ secrets.COMMITTER_TOKEN }}\n          # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n```\n\n### Manual trigger\n\nHow to set up this action to be manually triggered instead of being triggered by\npushing to a git tag:\n\n```yml\non:\n  workflow_dispatch:\n    inputs:\n      tag-name:\n        description: 'The git tag name to bump the formula to'\n        required: true\n\njobs:\n  homebrew:\n    name: Bump Homebrew formula\n    runs-on: ubuntu-latest\n    steps:\n      - uses: mislav/bump-homebrew-formula-action@v3\n        with:\n          formula-name: my_formula\n          tag-name: ${{ github.event.inputs.tag-name }}\n          download-url: https://example.com/foo/myproject-${{ github.event.inputs.tag-name }}.tar.gz\n        env:\n          COMMITTER_TOKEN: ${{ secrets.COMMITTER_TOKEN }}\n```\n\nYou could then use GitHub CLI to [trigger that workflow](https://cli.github.com/manual/gh_workflow_run):\n\n```sh\ngh workflow -R \u003cOWNER\u003e/\u003cREPO\u003e run release.yml --ref \u003cBRANCH\u003e -f \"tag-name=v1.2.3\"\n```\n\n## Known limitations\n\nThis action is designed to be minimal, fast, and to run with very few\nrequirements. For example, this action does not require a working Homebrew\ninstallation, nor cloning the Homebrew tap repository (since cloning the massive\n`Homebrew/homebrew-core` repository with git can take a long time). The only\nthing it does is using the GitHub API to make file edits to a Homebrew formula\nand to submit those edits as a PR.\n\nBecause of said design, this action is less featured than the [official `brew\nbump-formula-pr` command][1] that ships with Homebrew. Known limitations are:\n\n- Limited support for [bumping Homebrew casks](https://github.com/mislav/bump-homebrew-formula-action/issues/42#issuecomment-1410441868)\n\n- Cannot bump formulae that need their versions to be [synced with other formulae](https://github.com/mislav/bump-homebrew-formula-action/issues/44)\n\n- Cannot bump formulae which use Ruby `if...else` conditions to determine [alternate download locations](https://github.com/mislav/bump-homebrew-formula-action/issues/5) at runtime\n\n- Cannot bump Python-based formulae which [declare their PyPI dependencies](https://github.com/ansible/ansible-lint/pull/3812#issuecomment-1747105780) as additional `resource` blocks\n\n[1]: https://docs.brew.sh/How-To-Open-a-Homebrew-Pull-Request#submit-a-new-version-of-an-existing-formula\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmislav%2Fbump-homebrew-formula-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmislav%2Fbump-homebrew-formula-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmislav%2Fbump-homebrew-formula-action/lists"}