GithubHelp home page GithubHelp logo

homebrew / actions Goto Github PK

View Code? Open in Web Editor NEW
106.0 106.0 40.0 6.61 MB

:rocket: Homebrew's GitHub Actions

License: BSD 2-Clause "Simplified" License

JavaScript 53.01% Shell 44.64% Ruby 2.35%
actions homebrew

actions's Introduction

Homebrew (Legacy)

This repository was deprecated and split into two repositories:

actions's People

Contributors

bo98 avatar brewtestbot avatar carlocab avatar chenrui333 avatar cho-m avatar dawidd6 avatar dekker1 avatar dependabot[bot] avatar fncontroloption avatar imichka avatar jck112 avatar jonchang avatar josephsweeney avatar jpeach avatar miccal avatar mikemcquaid avatar mohzulfikar avatar nandahkrishna avatar p-linnane avatar razvanazamfirei avatar reitermarkus avatar rylan12 avatar seekingmeaning avatar smillerdev avatar vitorgalvao avatar zhongruoyu 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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

actions's Issues

Homebrew/actions/setup-homebrew@master - Issue

I am facing an issue with the setup-homebrew action. When I use the action using os macos-latest, I am not able to brew install anything. Here is an example github action file

name: brew test-bot
on:
  push:
    branches:
      - main
  pull_request:
jobs:
  test-bot:
    strategy:
      matrix:
        os: [macos-latest]
    runs-on: ${{ matrix.os }}
    steps:
       - name: Set up Homebrew
         id: set-up-homebrew
         uses: Homebrew/actions/setup-homebrew@master

      - name: Install Homebrew Bundler RubyGems
        run: brew install-bundler-gems

      - run: brew install rust

^^^ this action is failing for me at the brew install rust step, saying No available formula or cask with the name "rust".

However, if I edit my action file to be

name: brew test-bot
on:
  push:
    branches:
      - main
  pull_request:
jobs:
  test-bot:
    strategy:
      matrix:
        os: [macos-latest]
    runs-on: ${{ matrix.os }}
    steps:
      - name: Install Homebrew Bundler RubyGems
        run: brew install-bundler-gems

      - run: brew install rust

brew install rust works just fine.

This is an issue for me because I am creating a brew formula. The formula depends on rust, and the default workflows created by brew tap-new include this action, which is causing my bottling to fail because it can't find a brew formula named rust.

Bump Cask PR

Does it make sense to have an action for updating cask too?
Is it present for forumulae but not cask.

GitHub authorization header construction can fail on Linux

If the setup-homebrew action is configured with a custom GitHub token, then when the action encodes it into a basic authorization header using base64, it can end up being split into multiple lines because the default Linux behavior is to wrap the output at 76 columns. This results in a broken Authorization header, and GitHub access failing with HTTP 400 responses.

Suggestion: rerun only fails for long running builds

One of the things i have noticed that changing base formulae like go the number of tests we run is huge. This means that even if one fails we fail the whole build. An idea (based on something I implemented for my company) which might be interesting, is that for specific long runs, we re-run only the failed formulae, This was we account for flakiness and don't have to wait 12 hours. (in the case of golang etc)

I am happy to submit a formal proposal as to how to do this with github actions, (my current implementation does this for CircleCI). I wanted to make sure someone is not already working on this before I start investigating.

cc @SMillerDev @Bo98

`pr_body_content`: in homebrew-cask, empty body Cask PRs are labeled as `bump-cask-pr`

I am guessing this is an issue in the action, though, I am not sure.
Example: Homebrew/homebrew-cask#111815

Homebrew-cask's triage workflow
https://github.com/Homebrew/homebrew-cask/blob/master/.github/workflows/triage.yml#L35-L38

              }, {
                "label": "bump-cask-pr",
                "pr_body_content": "Created with `brew bump-cask-pr`"
              }

This may be due to defaulting to applying constraint on null PR body

if (body != null) {
constraintApplies = body.match(constraint.pr_body_content)
} else {
constraintApplies = true
}


Not sure how this will impact behavior in relation to labelExists, so need someone familiar with existing logic to comment.

Linter for checking github action yaml syntax

When I first contributed to this repository, It seems like there was no lint check for the action syntax on this repository as you can see on this PR. When a new contributor submits a PR about modifying action YAML they could write some typos that could make an error in the syntax.

Would it be great if we add a lint check to every action YAML or the modified one so that we could focus more on the code or modified part? Any suggestion about this?

`Setup Homebrew` action started failing

Inside of our public tap, the setup-homebrew action has started failing with Error: The process '/usr/bin/bash' failed with exit code 128. It was working this morning, but now when we even try running it with an empty commit, it keep failing with the same error message. We enabled debug logging to see if we could debug further. It looks like maybe the /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core directory doesn't exist?

Screen Shot 2023-02-17 at 1 34 00 PM

fatal: could not read Username for 'https://github.com': No such device or address

I've setup a private homebrew tap repo and trying to automate bottles build, but the initial setup step fails:

      - name: Set up Homebrew
        id: set-up-homebrew
        uses: Homebrew/actions/setup-homebrew@master
Run "$GITHUB_ACTION_PATH/main.sh" 'true' 'false'
  "$GITHUB_ACTION_PATH/main.sh" 'true' 'false'
  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
From https://github.com/Homebrew/brew
   1eaf8dbbe..ff2985c6a  master     -> origin/master
 * [new tag]             3.2.16     -> 3.2.16
 * [new tag]             3.2.17     -> 3.2.17
Switched to and reset branch 'master'
Branch 'master' set up to track remote branch 'master' from 'origin'.
Your branch is up to date with 'origin/master'.
mkdir: created directory '/home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/***'
mkdir: created directory '/home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/***/homebrew-tap'
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint: 
hint: 	git config --global init.defaultBranch <name>
hint: 
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint: 
hint: 	git branch -m <name>
Initialized empty Git repository in /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/***/homebrew-tap/.git/
'/home/runner/work/homebrew-tap/homebrew-tap' -> '/home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/***/homebrew-tap'
fatal: could not read Username for 'https://github.com': No such device or address
fatal: could not read Username for 'https://github.com': No such device or address
fatal: could not read Username for 'https://github.com': No such device or address
fatal: could not read Username for 'https://github.com': No such device or address
fatal: could not read Username for 'https://github.com': No such device or address

check-commit-style toggles automerge-skip label

I've noticed that the check-commit-style action doesn't add the automerge-skip label appropriately. Instead, it seems to toggle whether the label is applied or not. For example, opening a PR with an invalid commit will cause automerge-skip to be added. If you then force push a new commit that is still invalid, the automerge-skip label is removed. It should not be because the commit is still invalid.

I've noticed this a few times in homebrew/core, but I've opened a PR on a custom tap that illustrates the problem blocking any homebrew/core changes: Rylan12/homebrew-development#5

I created the PR based on Rylan12/homebrew-development@e4b004c and the automerge-skip label was applied.

Then, I forced pushed the branch to Rylan12/homebrew-development@e640a2d and the automerge-skip label was removed.

Both commits modify two files so the label should still be present.

I haven't done any testing yet to determine where the bug is. If I have time later, I'll try to take a look but I figured I'd file this in case someone else has an idea.

Setup Homebrew fails: aborting due to possible repository corruption on the remote side.

The action Set up Homebrew started failing today on my repo. It worked fine yesterday:

See https://github.com/gotson/komga/actions/runs/5409444712/jobs/9829975995 for the actual run.

Run Homebrew/actions/setup-homebrew@master
  with:
    test-bot: true
    debug: false
/bin/bash /Users/runner/work/_actions/Homebrew/actions/master/setup-homebrew/main.sh true false 
From https://github.com/Homebrew/brew
   e986[2](https://github.com/gotson/komga/actions/runs/5409444712/jobs/9829975995#step:3:2)64a[3](https://github.com/gotson/komga/actions/runs/5409444712/jobs/9829975995#step:3:3)..c5f[4](https://github.com/gotson/komga/actions/runs/5409444712/jobs/9829975995#step:3:4)d040a  master     -> origin/master
 * [new tag]             4.0.24     -> 4.0.24
 * [new tag]             4.0.2[5](https://github.com/gotson/komga/actions/runs/5409444712/jobs/9829975995#step:3:6)     -> 4.0.25
 * [new tag]             4.0.2[6](https://github.com/gotson/komga/actions/runs/5409444712/jobs/9829975995#step:3:7)     -> 4.0.26
Switched to and reset branch 'master'
branch 'master' set up to track 'origin/master'.
Your branch is up to date with 'origin/master'.
remote: fatal: object 365dd68d65da9d34653a[7](https://github.com/gotson/komga/actions/runs/5409444712/jobs/9829975995#step:3:8)fc2[8](https://github.com/gotson/komga/actions/runs/5409444712/jobs/9829975995#step:3:9)c0b2257008bee4d cannot be read        
remote: aborting due to possible repository corruption on the remote side.
fatal: protocol error: bad pack header
remote: fatal: object 365dd68d65da[9](https://github.com/gotson/komga/actions/runs/5409444712/jobs/9829975995#step:3:10)d34653a7fc28c0b2257008bee4d cannot be read        
remote: aborting due to possible repository corruption on the remote side.
fatal: protocol error: bad pack header
remote: fatal: object 365dd68d65da9d34653a7fc28c0b2257008bee4d cannot be read        
remote: aborting due to possible repository corruption on the remote side.
fatal: protocol error: bad pack header
remote: fatal: object 80a071c049c4f2e465e0b1c40cfc6325005ab05b cannot be read        
remote: aborting due to possible repository corruption on the remote side.
fatal: protocol error: bad pack header
remote: fatal: object 7c5d97418cdb6aee9f2305fa41dd990c00660f25 cannot be read        
remote: aborting due to possible repository corruption on the remote side.
fatal: protocol error: bad pack header
Error: The process '/bin/bash' failed with exit code [12](https://github.com/gotson/komga/actions/runs/5409444712/jobs/9829975995#step:3:13)8

Cache path for Homebrew Bundler RubyGems set up by setup-homebrew not valid

The setup-homebrew action (Homebrew/actions/setup-homebrew@master) has two outputs used to cache installed RubyGems by Homebrew bundler:

  • gems-path
  • gems-hash

Without any changes to the workflow files generated by Homebrew for a new tap, this will yield the following paths for macOS and Linux respectively:

  • /usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/
  • /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/

The cache action of both jobs reports an error for both paths however:

  • tar: ../../../../../usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby: Cannot stat: No such file or directory
  • /usr/bin/tar: ../../../../linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby: Cannot stat: No such file or directory

The install-bundler-gems command was successful in both cases (Bundled gems are installed into '../../../Homebrew/vendor/bundle') and the overall workflow finishes without issues, but the installed gems are never cached.

cancel-previous-runs make workflow an optional argument

Most likely the cancel-previous-runs was written to support cron jobs, but I actually like having it inside the action itself.

To avoid hardcoding a workflow_id, I tried for a while to programmatically get the workflow_id to pass to this action. I gave up in the end and hardcoded 'main.yml'.

I saw this other repo has a workaround, such that it is not a required argument anymore (only required when using as cron job).

How about having a similar workaround in this action?

Feature: action that limits amount of open pull requests by the same author

As shortly discussed at the AGM, it would be good to have a limit on the amount of pull requests someone can have open in a repository at one time to ensure that one contributor does not overwhelm maintainer availability.

Suggestion: max 10 PRs per user per repository, with an optional override with a label for maintainers. The goal should after all be to merge PRs more than to just have them open.

Error: inreplace failed when using `Homebrew/actions/bump-packages`

I'm using Homebrew/actions/bump-packages in my brew repo to update packages automatically, but there is an error:

Bundled gems are installed into `../../../../../usr/local/Homebrew/Library/Homebrew/vendor/bundle`
==> Downloading https://github.com/Goooler/StringResExporter/releases/download/v0.2.2/string-res-exporter-0.2.2-binary.jar
==> Downloading from https://objects.githubusercontent.com/github-production-release-asset-2e65be/741499626/357fc2a0-4c16-4ffd-8baf-22051a9c3318?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAVCODYLSA53PQK4ZA%2F20240215%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20240215T050834Z&X-Amz-Expires=300&X-Amz-Signature=5ee805d9c9abfed6dfb9dd3e6ee08363fed3e6dcd4976b0253d22b301eac9ac5&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=741499626&response-content-disposition=attachment%3B%20filename%3Dstring-res-exporter-0.2.2-binary.jar&response-content-type=application%2Foctet-stream
Warning: Cannot verify integrity of '97f76233d2e50c5cd018758c945c277ad49dedff501f559f5b527037124eee71--string-res-exporter-0.2.2-binary.jar'.
No checksum was provided.
For your reference, the checksum is:
  sha256 "5855d97a86116d4c0bbc6d6c88bf05679d58b468f426b0ae7cabff40[84](https://github.com/Goooler/homebrew-repo/actions/runs/7911366480/job/21595451390#step:4:86)19535d"
==> replace /https:\/\/github\.com\/Goooler\/StringResExporter\/releases\/download\/v0\.2\.1\/string\-res\-exporter\-0\.2\.1\-binary\.jar/ with "https://github.com/Goooler/StringResExporter/releases/download/v0.2.2/string-res-exporter-0.2.2-binary.jar"
Error: inreplace failed
/usr/local/Homebrew/Library/Taps/goooler/homebrew-repo/Formula/string-res-exporter.rb:
  expected replacement of /https:\/\/github\.com\/Goooler\/StringResExporter\/releases\/download\/v0\.2\.1\/string\-res\-exporter\-0\.2\.1\-binary\.jar/ with "https://github.com/Goooler/StringResExporter/releases/download/v0.2.2/string-res-exporter-0.2.2-binary.jar"
==> replace "3ef13f0d454f73b037c4bfa52bc6814fb92ab815cdaf66d2d8920c6e9728737c" with "5[85](https://github.com/Goooler/homebrew-repo/actions/runs/7911366480/job/21595451390#step:4:87)5d97a[86](https://github.com/Goooler/homebrew-repo/actions/runs/7911366480/job/21595451390#step:4:88)116d4c0bbc6d6c[88](https://github.com/Goooler/homebrew-repo/actions/runs/7911366480/job/21595451390#step:4:90)bf05679d58b468f426b0ae7cabff408419535d"

how can I fix it, is there any syntax error in my formula? See

Support Actions Artifacts v2 (i.e. upload-artifact v4)

Notable breaking change for the way we deal with bottles, that will require changes in multiple workflows and repositories:

Uploading to the same named Artifact multiple times.

Due to how Artifacts are created in this new version, it is no longer possible to upload to the same named Artifact multiple times. You must either split the uploads into multiple Artifacts with different names, or only upload once.

There's also some improvements that may make some things easier like:

Once uploaded, an Artifact ID is returned and Artifacts are immediately available in the UI and REST API. Previously, you would have to wait for the run to be completed before an ID was available or any APIs could be utilized.

Artifacts can now be downloaded and deleted from the UI before the entire workflow run finishes.

There was some difficulties we had with bottle caching and reruns that may have been solved here.

We can also probably deprecate Homebrew/actions/download-artifact:

This library (and actions/download-artifact) now support downloading Artifacts from other repositories and runs if a GITHUB_TOKEN with sufficient actions:read permissions are provided.

Worth noting however when we make the change that when switching to actions/download-artifact@v4:

Downloading artifacts that were created from action/upload-artifact@v3 and below are not supported.

This means we should probably do the switch at a time when a bunch of PRs aren't pending approval as all of them will need rebasing.


There will likely also be a GitHub blog post about all this soon.

These partially overlap in information, but all three are worth reading:

Changes in #324 break our actions/setup-homebrew deployment

Hi @Bo98 , I've read the changes in #324 , and it seems the way this change:

Adjust token behaviour to use HTTP headers rather than URL authentication.
This matches how actions/checkout behaves.

Changed how token authentication works broke the actions ability to clone a repo in the setup-homebrew action.

This is the error we're getting:

fatal: could not read Username for 'https://github.com/': No such device or address

Our setup has not changed since the last time we ran a test-bot workflow, here's what our invocation looks like:

      - name: Set up Homebrew
        id: set-up-homebrew
        uses: Homebrew/actions/setup-homebrew@master
        with:
          token: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }} 

Please let me know if there's any additional environmental variables we have to set up to get this working. Cheers!

setup-homebrew doesn't work in self-hosted GHA runners

We use a lot of self-hosted runners, and would love to use your setup-homebrew action on them, but we see errors like:

/usr/bin/bash /runner/_work/_actions/Homebrew/actions/master/setup-homebrew/main.sh false false auto false 
Could not find 'brew' command in PATH or standard locations.
Error: The process '/usr/bin/bash' failed with exit code 1

After invoking like:

      - name: Set up Homebrew
        id: set-up-homebrew
        uses: Homebrew/actions/setup-homebrew@master

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.