Git Product home page Git Product logo

action-homebrew-bump-formula's Introduction

Homebrew bump formula GitHub Action

An action that wraps brew bump-formula-pr to ease the process of updating the formula on new project releases.

Works on Ubuntu and macOS runners.

Usage

One should use the Personal Access Token for token input to this Action, not the default GITHUB_TOKEN, because brew bump-formula-pr creates a fork of the formula's tap repository (if needed) and then creates a pull request.

There are two ways to use this Action.

Standard mode

Use if you want to simply bump the formula, when a new release happens.

Listen for new tags in workflow:

on:
  push:
    tags:
      - '*'

The Action will extract all needed informations by itself, you just need to specify the following step in your workflow:

- name: Update Homebrew formula
  uses: dawidd6/action-homebrew-bump-formula@v3
  with:
    # Required, custom GitHub access token with the 'public_repo' and 'workflow' scopes
    token: ${{secrets.TOKEN}}
    # Optional, will commit with this user name
    user_name: name
    # Optional, will commit with this user email
    user_email: [email protected]
    # Optional, will create tap repo fork in organization
    org: ORG
    # Optional, use the origin repository instead of forking
    no_fork: false
    # Optional, defaults to homebrew/core
    tap: USER/REPO
    # Formula name, required
    formula: FORMULA
    # Optional, will be determined automatically
    tag: ${{github.ref}}
    # Optional, will be determined automatically
    revision: ${{github.sha}}
    # Optional, if don't want to check for already open PRs
    force: false # true

Livecheck mode

If livecheck input is set to true, the Action will run brew livecheck to check if any provided formulae are outdated or if tap contains any outdated formulae and then will run brew bump-formula-pr on each of those formulae with proper arguments to bump them.

Might be a good idea to run this on schedule in your tap repo, so one gets automated PRs updating outdated formulae.

If there are no outdated formulae, the Action will just exit.

- name: Update Homebrew formula
  uses: dawidd6/action-homebrew-bump-formula@v3
  with:
    # Required, custom personal GitHub access token with only the 'public_repo' scope enabled
    token: ${{secrets.CUSTOM_PERSONAL_ACCESS_TOKEN}}
    # Optional, will commit with this user name
    user_name: user_name
    # Optional, will commit with this user email
    user_email: [email protected]
    # Optional, will create tap repo fork in organization
    org: ORG
    # Bump all outdated formulae in this tap
    tap: USER/REPO
    # Bump only these formulae if outdated
    formula: FORMULA-1, FORMULA-2, FORMULA-3, ...
    # Optional, if don't want to check for already open PRs
    force: false # true
    # Need to set this input if want to use `brew livecheck`
    livecheck: true

If only tap input is provided, all formulae in given tap will be checked and bumped if needed.

Examples

action-homebrew-bump-formula's People

Contributors

5ouma avatar dawidd6 avatar ddelange avatar dependabot-preview[bot] avatar fauxpark avatar iloveitaly avatar jasonkarns avatar jfoster avatar spacewander avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

action-homebrew-bump-formula's Issues

Allow editing the Git user name and email

This action automatically sets user.name and user.email to the owner.

# Get user details
user = GitHub::API.open_rest "#{GitHub::API_URL}/user"
user_id = user['id']
user_login = user['login']
user_name = user['name'] || user['login']
user_email = user['email'] || (
# https://help.github.com/en/github/setting-up-and-managing-your-github-user-account/setting-your-commit-email-address
user_created_at = Date.parse user['created_at']
plus_after_date = Date.parse '2017-07-18'
need_plus_email = (user_created_at - plus_after_date).positive?
user_email = "#{user_login}@users.noreply.github.com"
user_email = "#{user_id}+#{user_email}" if need_plus_email
user_email
)
# Tell git who you are
git 'config', '--global', 'user.name', user_name
git 'config', '--global', 'user.email', user_email

However, I want them to be github-actions[bot].
I tried to set these environment variables, but it ignored them.

HOMEBREW_GIT_NAME: github-actions[bot]
HOMEBREW_GIT_EMAIL: 41898282+github-actions[bot]@users.noreply.github.com

If any of these are set, it should respect these env.

  • HOMEBREW_GIT_NAME
  • HOMEBREW_GIT_EMAIL
  • GIT_AUTHOR_NAME
  • GIT_AUTHOR_EMAIL

In addition, I want to change the PR author to it, but I'm not sure how to do it. If anyone knows this, please let me know.

inplace replace failed: expected replacement of `v0.8.0` when latest version is `v0.8.8`

Thanks for making this github action!

I'm trying to update this formula on a release: https://github.com/Homebrew/homebrew-core/blob/master/Formula/taskwarrior-tui.rb

It worked as expected once. However, the next couple of times I made a tag I got the following error.

https://github.com/kdheepak/taskwarrior-tui/runs/1305070251#step:2:58

HEAD is now at f3cf85f100 orc-tools 1.6.5
==> Downloading v0.8.8.tar.gz
==> Downloading from codeload.github.com/kdheepak/taskwarrior-tui/tar.gz/v0.8.8
Warning: Cannot verify integrity of f398f3541aadf5fc7f3cdcf40e3935da0c4d852d03ed06859d1ba321562b2535--taskwarrior-tui-0.8.8.tar.gz
Error: inreplace failed
/home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/taskwarrior-tui.rb:
  expected replacement of /https:\/\/github\.com\/kdheepak\/taskwarrior\-tui\/archive\/v0\.8\.0\.tar\.gz/ with "v0.8.8.tar.gz"
  expected replacement of "15a2195dde970f369b5b1e346a087c72581142525765baeffe8d54b95824bae0" with "36e3a1feaa48bc04b4d49f936a35da83006566fd9abda43811edb51246a1ce73"
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/utils.rb:288:in `safe_system': Failure while executing; `brew bump-formula-pr --no-audit --no-browse --message=\[\`action-homebrew-bump-formula\`\]\(https://github.com/dawidd6/action-homebrew-bump-formula\) --version=0.8.8 --url=v0.8.8.tar.gz taskwarrior-tui` exited with 1. (ErrorDuringExecution)
A checksum was not provided for this resource.
	from /home/runner/work/_actions/dawidd6/action-homebrew-bump-formula/v3/main.rb:28:in `brew'
	from /home/runner/work/_actions/dawidd6/action-homebrew-bump-formula/v3/main.rb:116:in `<module:Homebrew>'
	from /home/runner/work/_actions/dawidd6/action-homebrew-bump-formula/v3/main.rb:17:in `<main>'
For your reference the SHA-256 is: 36e3a1feaa48bc04b4d49f936a35da83006566fd9abda43811edb51246a1ce73
==> replace /https:\/\/github\.com\/kdheepak\/taskwarrior\-tui\/archive\/v0\.8\.0\.tar\.gz/ with "v0.8.8.tar.gz"
==> replace "15a2195dde970f369b5b1e346a087c72581142525765baeffe8d54b95824bae0" with "36e3a1feaa48bc04b4d49f936a35da83006566fd9abda43811edb51246a1ce73"

It appears as though the old repo is not updated (?). I don't fully understand what is going on here. I get the same error when I try to re-run the workflow.

I also tried to delete the fork of homebrew-core, and the workflow creates a fork as expected, but I get a different error in that case.

https://github.com/kdheepak/taskwarrior-tui/runs/1306371332

This says it is a permissions error, which I don't know why it would be the case. It is able to create the fork and it worked when I tried to update the formula before. See this PR for reference: Homebrew/homebrew-core#63451.

Fails when url doesn't contain exact version string

Thanks for maintaining this GitHub Action - it's been very helpful!

I have a formula (see here) where the tarball url does not contain the periods from the version string. For example, the package version is 8.307 and the tarball url contains "8307". There are other formulae like this in homebrew-core (see here).

Running brew bump-formula-pr with only the --version argument attempts to update the URL using string substitution. Since the old url does not contain the old version string, it's unable to perform the substitution and so it cannot infer the new url. It raises the error You need to bump this formula manually since the new URL and old URL are both <old_url>.

Normally, the solution to this issue is to specify the --url argument. The difficulty for the GitHub Action is that we can't retrieve the new url from the livecheck command, so we can't automate this AFAIK.

Perhaps this underlying assumption should be documented? (i.e., URL must include version string exactly)

What permissions are required to execute the action?

I have the project https://github.com/box-project/box which publishes an artifact box.phar that is uploaded to each release. I also have the homebrew formula living in https://github.com/box-project/homebrew-box, which requires the tap humbug/box.

Keeping it up to date has been a bit tedious so I'm trying to automate it via this action. I have the following configuration in https://github.com/box-project/box:

    publish-homebrew-tap:
        runs-on: ubuntu-latest
        name: Publish Homebrew tap
        needs:
            - publish-phar
        if: github.event_name == 'release'
        steps:
            -   name: Update Homebrew formula
                uses: dawidd6/action-homebrew-bump-formula@v3
                with:
                    token: ${{ secrets.BOX_HOMEBREW_TAP_TOKEN }}
                    tap: box-project/box
                    formula: box
                    tag: ${{ github.event.release.tag_name }}
                    revision: ${{ github.event.release.target_commitish }}

(the full workflow can be found here)

The BOX_HOMEBREW_TAP_TOKEN is a fine-grained access token which has access to:

  • The repositories box-project/box and box-project/homebrew-box
  • Read access to metadata
  • Read and Write access to actions, code, commit statuses, pull requests, and workflows

I expected this to be enough but that does not seem to be the case: https://github.com/box-project/box/actions/runs/4330997891/jobs/7562608715#step:2:233

Do you know by any chance what fine-grained permissions are required to make it work?

Failed to download resource in action

Why download at https://codeload.github.com?

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at 88132eb4a1c yeti: revert revision bump
==> Downloading https://github.com/sunny0826/kubecm/archive/v0.10.4.tar.gz
==> Downloading from https://codeload.github.com/sunny0826/kubecm/tar.gz/v0.10.4
curl: (22) The requested URL returned error: 404 Not Found
Error: Failed to download resource "kubecm"
Download failed: https://github.com/sunny0826/kubecm/archive/v0.10.4.tar.gz
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/utils.rb:294:in `safe_system': Failure while executing; `brew bump-formula-pr --no-audit --no-browse --message=\[\`action-homebrew-bump-formula\`\]\(https://github.com/dawidd6/action-homebrew-bump-formula\) --url=https://github.com/sunny0826/kubecm/archive/v0.10.4.tar.gz kubecm` exited with 1. (ErrorDuringExecution)
	from /home/runner/work/_actions/dawidd6/action-homebrew-bump-formula/v3.1.1/main.rb:22:in `brew'
	from /home/runner/work/_actions/dawidd6/action-homebrew-bump-formula/v3.1.1/main.rb:105:in `<module:Homebrew>'
	from /home/runner/work/_actions/dawidd6/action-homebrew-bump-formula/v3.1.1/main.rb:15:in `<main>'
Error: The process '/home/linuxbrew/.linuxbrew/bin/brew' failed with exit code 1

Strange behavior following action execution

Hey @dawidd6, I've just experienced a pretty strange behavior.

The action (v3.8.0) launched itself as I released Archey v4.14.0.0 (job), and failed with an error I've never had before :

==> Retrieving PyPI dependencies for "archey4==4.14.0.0"...
Error: Unable to determine dependencies for "archey4==4.14.0.0" because of a failure when running
`/usr/local/opt/pipgrip/bin/pipgrip --json --tree --no-cache-dir archey4==4.14.0.0`.
Please update the resources for "archey4" manually.
/usr/local/Homebrew/Library/Homebrew/utils.rb:323:in `safe_system': Failure while executing; `/usr/local/bin/brew bump-formula-pr --no-audit --no-browse --message=\[\`action-homebrew-bump-formula\`\]\([https://github.com/dawidd6/action-homebrew-bump-formula\](https://github.com/dawidd6/action-homebrew-bump-formula/)) --version=4.14.0.0 --url=https://files.pythonhosted.org/packages/84/a0/adc84fed924b67df29d762b45c79b836a17a4431185c866be0ad366edd6d/archey4-4.14.0.0.tar.gz archey4` exited with 1. (ErrorDuringExecution)
	from /Users/runner/work/_actions/dawidd6/action-homebrew-bump-formula/v3/main.rb:27:in `brew'
	from /Users/runner/work/_actions/dawidd6/action-homebrew-bump-formula/v3/main.rb:112:in `<module:Homebrew>'
	from /Users/runner/work/_actions/dawidd6/action-homebrew-bump-formula/v3/main.rb:18:in `<main>'
Error: Process completed with exit code 1.

... but a PR Homebrew/homebrew-core#111436 has been (automatically ?) created by @Curudel (bump commit on their fork).

Two questions :

  1. What do you think about the pipgrip error ? I've personally replayed the step on my machine, and it worked well.
  2. What do you think about the above PR created at the exact same time (3:03 PM UTC), but not on my own fork and without my account permissions ?

Many thanks, bye ๐Ÿ‘‹

Action fails with "No available formula"

Hello. ๐Ÿ‘‹๐Ÿป

PHPStan uses your very helpful GitHub action to bump their Homebrew package on each release. It has served us well for a while, but recently it started to fail:

Error: No available formula with the name "phpstan".

Examples:

This is the workflow, PHPStan is using: https://github.com/phpstan/phpstan/blob/34881e639fcadb85cbca23dfae27afbb783102ac/.github/workflows/release-homebrew.yml

Bumping the formula manually on a Mac, running brew bump-formula-pr --version 1.10.0 phpstan still works.

'Formulae must have a ref! (ArgumentError)'

Encountering this error when trying to use this on my personal homebrew tap, which includes both formulae and casks:

/usr/local/bin/brew tap jfoster/homebrew-tap
==> Tapping jfoster/tap
Cloning into '/usr/local/Homebrew/Library/Taps/jfoster/homebrew-tap'...
Tapped 5 casks and 7 formulae (44 files, 138.5KB).
/usr/local/bin/brew livecheck --quiet --newer-only --full-name --json --tap=jfoster/homebrew-tap
/usr/local/Homebrew/Library/Homebrew/formulary.rb:366:in `factory': Formulae must have a ref! (ArgumentError)
	from /usr/local/Homebrew/Library/Homebrew/formula.rb:1645:in `[]'
	from /Users/runner/work/_actions/dawidd6/action-homebrew-bump-formula/v3/main.rb:151:in `block in <module:Homebrew>'
	from /Users/runner/work/_actions/dawidd6/action-homebrew-bump-formula/v3/main.rb:142:in `each'
	from /Users/runner/work/_actions/dawidd6/action-homebrew-bump-formula/v3/main.rb:142:in `<module:Homebrew>'
	from /Users/runner/work/_actions/dawidd6/action-homebrew-bump-formula/v3/main.rb:18:in `<main>'
Error: Process completed with exit code 1.

Upon investigating this line it appears it simply does not expect a cask as an argument?
If this is intended behavior I'd suggested passing a --formula argument to livecheck to disable the checking of casks (I will submit a PR for this).
It would be awesome if this action could support casks, possibly making use of bump-cask-pr?

Please HELP~

Here's my workflow.yml

 bump-homebrew-formula:
    runs-on: macos-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v2
      - name: Bump Homebrew formulae
        uses: dawidd6/action-homebrew-bump-formula@v3
        with:
          # Required, custom GitHub access token with the 'public_repo' and 'workflow' scopes
          token: ${{secrets.HOMEBREW_GITHUB_API_TOKEN}}
          # Optional, will create tap repo fork in organization
          # org: ORG
          # Optional, defaults to homebrew/core
          # tap: USER/REPO
          # Formula name, required
          formula: hg-tui
          # Optional, will be determined automatically
          tag: ${{github.ref}}
          # Optional, will be determined automatically
          revision: ${{github.sha}}
          # Optional, if don't want to check for already open PRs
          # force: false # true

image

But got this action error:

image

Please HELP, What can I do to fix this?

By the way, this is my first time to try publish a project to homebrew~

Feature request: make url input conventional

I have about a dozen workflows that use this action and 100% of them are intended to bump the formula for the current repository using the current github.ref.

It seems quite redundant to pass in inputs that are already available via the github context. Thoughts on making the URL conventional?

ie, have it default to something like: https://github.com/${{github.repository}}/archive/${github.ref#refs/tags/}.tar.gz

(with the context references replaced with the appropriate env vars, of course)

Since the current implementation assumes an empty URL to mean tag+revision are necessary, and since those attributes can also be inferred from context, I would propose some other signal to indicate url vs tag+revision. Perhaps there's a brew command that we could use to determine which flavor the formula uses.

Allow adding to the PR message

Right now, this action uses a constant message to append to the call to bump-formula-pr. Would you support adding the ability to put in a message in the yml that would then get prepended to this constant message?

My use-case is that for asciidoc, I plan to move from running the action under my personal GH account to a bot account, but would like to have within the body of the PR a ping to my primary account.

Action failed with transfer closed with outstanding read data remaining

I just started using this action and I got this error:

==> Fetching homebrew/master
fatal: unable to access 'https://github.com/Homebrew/homebrew-core/': transfer closed with outstanding read data remaining
Error: Failure while executing; `git fetch homebrew master` exited with 128.
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/utils.rb:287:in `safe_system': Failure while executing; `brew bump-formula-pr --no-audit --no-browse --message=\[\`action-homebrew-bump-formula\`\]\(https://github.com/dawidd6/action-homebrew-bump-formula\) --version=0.10.1 --url=https://github.com/terraform-docs/terraform-docs/archive/v0.10.1.tar.gz terraform-docs` exited with 1. (ErrorDuringExecution)
	from /home/runner/work/_actions/dawidd6/action-homebrew-bump-formula/v3.4.1/main.rb:28:in `brew'
	from /home/runner/work/_actions/dawidd6/action-homebrew-bump-formula/v3.4.1/main.rb:116:in `<module:Homebrew>'
	from /home/runner/work/_actions/dawidd6/action-homebrew-bump-formula/v3.4.1/main.rb:17:in `<main>'
Error: Process completed with exit code 1.

Full log can be found here.

Steps were:

Coincidentally I noticed, at the time of this failure, github had an incident and Action has been degraded, so I wasn't able to pinpoint the problem to the GH Action or this action or my setup.

Update existing PR if it exists

Sometimes I'll create a release and then this action will create a PR for me (e.g. v5.0.0), and then I'll soon afterwards push a new release with a bugfix in it (e.g. v5.0.1). Currently, the action will fail due to an existing PR being present. I would instead like it to push a new commit to the existing PR with the updated formula.

I'm not sure if this is possible. If people think this behaviour shouldn't be enabled by default, perhaps it could be an optional flag

Also hope you're doing well @dawidd6 !

Error: undefined method `git_origin_branch' for #<Pathname:...>

I was happily using action-homebrew-bump-formula for several months (last successful run was 3 days ago), until today it suddenly broke with

Bundled gems are installed into `../../../../linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle`
Error: undefined method `git_origin_branch' for #<Pathname:0x0000558587649a80>
Do not report this issue until you've run `brew update` and tried again.
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/dev-cmd/bump-formula-pr.rb:126:in `bump_formula_pr'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb:94:in `<main>'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/extend/kernel.rb:243:in `safe_system': Failure while executing; `/home/linuxbrew/.linuxbrew/bin/brew bump-formula-pr --no-audit --no-browse --message=\[\`action-homebrew-bump-formula\`\]\([https://github.com/dawidd6/action-homebrew-bump-formula\](https://github.com/dawidd6/action-homebrew-bump-formula/)) --version=0.6.0 octobuild` exited with 1. (ErrorDuringExecution)
	from /home/runner/work/_actions/dawidd6/action-homebrew-bump-formula/v3/main.rb:26:in `brew'
	from /home/runner/work/_actions/dawidd6/action-homebrew-bump-formula/v3/main.rb:105:in `<module:Homebrew>'
	from /home/runner/work/_actions/dawidd6/action-homebrew-bump-formula/v3/main.rb:17:in `<main>'

https://github.com/octobuild/octobuild/actions/runs/4721924692/jobs/8375810652

Any thoughts how to fix this?

[BUG] Spurious "error: failed to push some refs"

Hey @dawidd6 ! Firstly, thanks for this awesome action.

I've set up a (both automatic and manual) deployment job using your action here.
It ended up working well, except for a previous run, where it crashed with :

Switched to a new branch 'bump-archey4-4.13.1'
M	Formula/archey4.rb
[bump-archey4-4.13.1 8d36629c7c] archey4 4.13.1
 1 file changed, 2 insertions(+), 2 deletions(-)
remote: fatal error in commit_refs        
To HorlogeSkynet/homebrew-core.git
 ! [remote rejected]       bump-archey4-4.13.1 -> bump-archey4-4.13.1 (failure)
error: failed to push some refs to 'HorlogeSkynet/homebrew-core.git'
Error: Failure while executing; `git push --set-upstream https://***@github.com/HorlogeSkynet/homebrew-core.git bump-archey4-4.13.1:bump-archey4-4.13.1` exited with 1.
/usr/local/Homebrew/Library/Homebrew/utils.rb:322:in `safe_system': Failure while executing; `/usr/local/bin/brew bump-formula-pr --no-audit --no-browse --message=\[\`action-homebrew-bump-formula\`\]\(https://github.com/dawidd6/action-homebrew-bump-formula\) --version=4.13.1 --url=files.pythonhosted.org/packages/54/60/212f5018cc4671fd6b288faf2018ff74e8fcf68703c72e31bcea9ca6217a/archey4-4.13.1.tar.gz archey4` exited with 1. (ErrorDuringExecution)
	from /Users/runner/work/_actions/dawidd6/action-homebrew-bump-formula/v3/main.rb:27:in `brew'
	from /Users/runner/work/_actions/dawidd6/action-homebrew-bump-formula/v3/main.rb:112:in `<module:Homebrew>'
	from /Users/runner/work/_actions/dawidd6/action-homebrew-bump-formula/v3/main.rb:18:in `<main>'
Error: Process completed with exit code 1.

When I ran it again (so this time the forked repository was already existing), it succeeded :

Switched to a new branch 'bump-archey4-4.13.1'
M	Formula/archey4.rb
[bump-archey4-4.13.1 971a38c1f1] archey4 4.13.1
 1 file changed, 2 insertions(+), 2 deletions(-)
remote: 
remote: Create a pull request for 'bump-archey4-4.13.1' on GitHub by visiting:        
remote:      HorlogeSkynet/homebrew-core/pull/new/bump-archey4-4.13.1        
remote: 
To HorlogeSkynet/homebrew-core.git
 * [new branch]            bump-archey4-4.13.1 -> bump-archey4-4.13.1
Branch 'bump-archey4-4.13.1' set up to track remote branch 'bump-archey4-4.13.1' from 'https://***@github.com/HorlogeSkynet/homebrew-core.git'.

Do you think it would be possible a race condition might occur while the repository is being forked ?

Thanks, bye ๐Ÿ‘‹

Could not read Password, No such device or address

I'm getting fatal: could not read Password for 'https:// ***@github.com': No such device or address error while trying to run the action. Full log:

 [bump-terraform-docs-0.11.1 fffdefbf24d] terraform-docs 0.11.1
 1 file changed, 2 insertions(+), 2 deletions(-)
fatal: could not read Password for 'https:// ***@github.com': No such device or address
Error: Failure while executing; `git push --set-upstream https://\ ***@github.com/tf-docs-bot/homebrew-core.git bump-terraform-docs-0.11.1:bump-terraform-docs-0.11.1` exited with 128.
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/utils.rb:321:in `safe_system': Failure while executing; `brew bump-formula-pr --no-audit --no-browse --message=\[\`action-homebrew-bump-formula\`\]\(https://github.com/dawidd6/action-homebrew-bump-formula\) --version=0.11.1 --url=https://github.com/terraform-docs/terraform-docs/archive/v0.11.1.tar.gz terraform-docs` exited with 1. (ErrorDuringExecution)
	from /home/runner/work/_actions/dawidd6/action-homebrew-bump-formula/v3.5.1/main.rb:28:in `brew'
	from /home/runner/work/_actions/dawidd6/action-homebrew-bump-formula/v3.5.1/main.rb:116:in `<module:Homebrew>'
	from /home/runner/work/_actions/dawidd6/action-homebrew-bump-formula/v3.5.1/main.rb:17:in `<main>'

And the action part is:

  homebrew:
    runs-on: ubuntu-latest
    steps:
      - name: Bump Homebrew formula version
        uses: dawidd6/[email protected]
        with:
          token: ${{ secrets.COMMITTER_TOKEN }}

COMMITTER_TOKEN is a custom PAT with repo and workflow scopes.

My initial idea was that I was using older version of action (3.5.1) and thought if I update to latest (3.7.0) that'll fix it but before doing that I noticed that token seems to be removed as part of this commit.

Failure while executing; `brew livecheck ...`

 [command]git config --global user.name chenrui
 [command]git config --global user.email [email protected]
 [command]brew livecheck --quiet --newer-only --full-name --json
 /usr/local/Homebrew/Library/Homebrew/utils/popen.rb:16:in `safe_popen_read': Failure while executing; `brew livecheck --quiet --newer-only --full-name --json` exited with 1. Here's the output: (ErrorDuringExecution)
 	from /Users/runner/work/_actions/dawidd6/action-homebrew-bump-formula/v3/main.rb:42:in `read_brew'
 	from /Users/runner/work/_actions/dawidd6/action-homebrew-bump-formula/v3/main.rb:134:in `<module:Homebrew>'
 	from /Users/runner/work/_actions/dawidd6/action-homebrew-bump-formula/v3/main.rb:17:in `<main>'

GITHUB_TOKEN permissions used by this action

At https://github.com/step-security/secure-workflows we are building a knowledge-base (KB) of GITHUB_TOKEN permissions needed by different GitHub Actions. When developers try to set minimum token permissions for their workflows, they can use this knowledge-base instead of trying to research permissions needed by each GitHub Action they use.
Below you can see the KB of your GITHUB Action.

name: Homebrew bump formula
#GITHUB_TOKEN not used
#FIXES: #494

This issue is automatically created by our analysis bot, feel free to close after reading :)

References:

GitHub asks users to define workflow permissions, see https://github.blog/changelog/2021-04-20-github-actions-control-permissions-for-github_token/ and https://docs.github.com/en/actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token for securing GitHub workflows against supply-chain attacks.
Setting minimum token permissions is also checked for by Open Source Security Foundation (OpenSSF) Scorecards. Scorecards recommend using https://github.com/step-security/secure-workflows so developers can fix this issue in an easier manner.

Unexpected parsing of Git tag

Hello,

I'm tagging my repo in the following format: v0.0.1, but the version passed to brew ends up without 'v':

/opt/homebrew/bin/brew bump-formula-pr --no-audit --no-browse --message=[`action-homebrew-bump-formula`](https://github.com/dawidd6/action-homebrew-bump-formula) --no-fork --version=0.0.1 NorseDreki/tap/dogcat

Which fails to download sources at URL, because 'v' prefix is missing:

Download failed: https://github.com/NorseDreki/dogcat/archive/refs/tags/0.0.1.tar.gz

Is it possible to fix?
Thank you.

Error: Query must include 'is:issue' or 'is:pull-request'

I'm trying to use this action to update formulas in my personal tap, but an error is preventing me from doing so.

Logs:

<omitted, installing bundler deps>
Bundle complete! 35 Gemfile dependencies, 77 gems now installed.
Bundled gems are installed into `../../../../linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle`
Error: Query must include 'is:issue' or 'is:pull-request'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/utils.rb:323:in `safe_system': Failure while executing; `/home/linuxbrew/.linuxbrew/bin/brew bump-formula-pr --no-audit --no-browse --message=\[\`action-homebrew-bump-formula\`\]\([https://github.com/dawidd6/action-homebrew-bump-formula\](https://github.com/dawidd6/action-homebrew-bump-formula/)) --tag=v0.1.7 --revision=1cb39a47fd1735e6bc39ee5b4493b8c49bfe2780 bartekpacia/homebrew-tools/shell-scripts` exited with 1. (ErrorDuringExecution)
	from /home/runner/work/_actions/dawidd6/action-homebrew-bump-formula/v3/main.rb:27:in `brew'
	from /home/runner/work/_actions/dawidd6/action-homebrew-bump-formula/v3/main.rb:112:in `<module:Homebrew>'
	from /home/runner/work/_actions/dawidd6/action-homebrew-bump-formula/v3/main.rb:18:in `<main>'
Error: Process completed with exit code 1.

Here's the link to my workflow. I'd be very grateful for any help.

Unable to fork: Not Found

I'm getting the following error when I run this workflow:

https://github.com/kdheepak/taskwarrior-tui/runs/1569338587#step:2:103

git config --global user.name Dheepak Krishnamurthy
git config --global user.email [email protected]
brew bump-formula-pr --no-audit --no-browse --message=[`action-homebrew-bump-formula`](dawidd6/action-homebrew-bump-formula) --version=0.9.5 --url=v0.9.5.tar.gz taskwarrior-tui
==> Downloading v0.9.5.tar.gz
==> Downloading from codeload.github.com/kdheepak/taskwarrior-tui/tar.gz/v0.9.5
Warning: Cannot verify integrity of '98ec77c25f8c23f3415ef2a68277bcbb262dbb3944eb2d5e33ed304511ab9000--taskwarrior-tui-0.9.5.tar.gz'.
No checksum was provided for this resource.
For your reference, the checksum is:
  sha256 "1e31623a1b372c5cfa628fadb45c5c4d6e7bee3ca17959d923f28651ba1040e8"
==> replace /https:\/\/github\.com\/kdheepak\/taskwarrior\-tui\/archive\/v0\.9\.4\.tar\.gz/ with "v0.9.5.tar.gz"
==> replace "ec0d909a666d5d8319f86bf715036635d5ec9899bdb242d1eb3e2cbb4c04d2d2" with "1e31623a1b372c5cfa628fadb45c5c4d6e7bee3ca17959d923f28651ba1040e8"
==> Skipping `brew audit`
Error: Unable to fork: Not Found!
/usr/local/Homebrew/Library/Homebrew/utils.rb:303:in `safe_system': Failure while executing; `brew bump-formula-pr --no-audit --no-browse --message=\[\`action-homebrew-bump-formula\`\]\(https://github.com/dawidd6/action-homebrew-bump-formula\) --version=0.9.5 --url=v0.9.5.tar.gz taskwarrior-tui` exited with 1. (ErrorDuringExecution)
	from /Users/runner/work/_actions/dawidd6/action-homebrew-bump-formula/v3/main.rb:28:in `brew'
	from /Users/runner/work/_actions/dawidd6/action-homebrew-bump-formula/v3/main.rb:116:in `<module:Homebrew>'
	from /Users/runner/work/_actions/dawidd6/action-homebrew-bump-formula/v3/main.rb:17:in `<main>'
Error: Process completed with exit code 1.

Any idea what might be going on?

Errors on formula with license

The errors for example on brew livecheck --quiet --newer-only --full-name --json node-build with the following errror whereas it works locally.

/usr/local/Homebrew/Library/Homebrew/formulary.rb:38:in rescue in load_formula': node-build: undefined method license' for #Class:0x00007fa494a76378 (FormulaUnreadableError)

Since your action uses the latest homebrew version and taps livecheck this shouldn't be a problem or am I missing the obvious here?

Here is an example of the error: https://github.com/crunchtime-ali/brew-formula-updater/runs/845486568

refusing to allow a Personal Access Token to create or update workflow .github/workflows/autobump.yml without workflow scope

Thanks for this wonderful action, @dawidd6!

When I tried it, I got an error during pushing the code:

refusing to allow a Personal Access Token to create or update workflow .github/workflows/autobump.yml without workflow scope

After I gave the workflow scope to the Personal Access Token, this action works well for me.

Maybe we should update the doc to mention the new scope?

GitHub::API::AuthenticationFailedError

Hello, I'm not sure what I'm doing wrong. Thanks for your help!

Screenshot 2022-06-26 at 21 17 02

Here's my Personal access tokens:

Screenshot 2022-06-26 at 21 17 23

Here's my action:

name: Release to Homebrew
on:
  release:
    types: [created]
jobs:
  homebrew-core:
    runs-on: macos-latest
    steps:
    - uses: dawidd6/action-homebrew-bump-formula@v3
      with:
        token: ${{secrets.HOMEBREW_FORMULA_GH_TOKEN}}
        formula: dotdrop

Help with updating formula

Hello, thanks for this project!

In our project we are trying to use it, I'm no Mac user but some of our users want to have it available on Mac.

I was wondering if you could help me with the following error:
https://github.com/commitizen-tools/commitizen/runs/1844420295?check_suite_focus=true

Our current workflow is as this:
action1 creates tag
on tag creation, action2 publishes our package to python's pip
when action2 is complete, we trigger the publish to homebrew, but it fails.

Any kind of help would be useful.
Thanks!

Tap `homebrew/core` with `--force` option

Due to the change to download a JSON file of Formulae, tapping homebrew/core makes an error. Adding the --force option to the brew tap command should correct this issue.
Also, it might be good to tap homebrew/core only when tap is empty.

if tap.blank?
  brew 'tap', 'homebrew/core', '--force'
else
  brew 'tap', tap
end

The failed job on my GitHub Action

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.