homebrew-core icon indicating copy to clipboard operation
homebrew-core copied to clipboard

Update github actions to use composite action created before

Open mohzulfikar opened this issue 1 year ago • 10 comments

  • [x] Have you followed the guidelines for contributing?
  • [x] Have you ensured that your commits follow the commit style guide?
  • [x] Have you checked that there aren't other open pull requests for the same formula update/change?
  • [ ] Have you built your formula locally with brew install --build-from-source <formula>, where <formula> is the name of the formula you're submitting?
  • [ ] Is your test running fine brew test <formula>, where <formula> is the name of the formula you're submitting?
  • [ ] Does your build pass brew audit --strict <formula> (after doing brew install --build-from-source <formula>)? If this is a new formula, does it pass brew audit --new <formula>?

mohzulfikar avatar Jul 19 '22 18:07 mohzulfikar

Here, I modified the github action to use the composite action I created on Homebrew/actions#289. Any feedback would be appreciated

mohzulfikar avatar Jul 19 '22 18:07 mohzulfikar

I don't think the old version errored when it tried to do touch -- we should probably try to replicate that behaviour.

carlocab avatar Jul 20 '22 00:07 carlocab

I think you're right. We should look into that. @mohzulfikar, you can see the options that are set for bash here: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsshell

mistydemeo avatar Jul 20 '22 02:07 mistydemeo

Wild guess: the action doesn't inherit permissions set in the calling workflow

carlocab avatar Jul 20 '22 02:07 carlocab

That's weird actually. It passed on macos but not on linux. Any idea on how to debug this?

mohzulfikar avatar Jul 20 '22 14:07 mohzulfikar

Probably user permissions -- the container runs as user linuxbrew, but GitHub Actions expects something else. It may be that it's the GHA user running your action?

carlocab avatar Jul 20 '22 15:07 carlocab

Hi there, sorry for stalling this PR. I've found the root cause for failing CI on Linux. It's because the working directory is not the default (set on the matrix). I want to test this change using my modified composite action first to see if it works.

mohzulfikar avatar Aug 08 '22 03:08 mohzulfikar

But, it seems like the CI is not triggered, is there something I miss?

mohzulfikar avatar Aug 08 '22 03:08 mohzulfikar

mohzulfikar/actions@main is not allowed to be used in Homebrew/homebrew-core. Actions in this workflow must be: within a repository owned by Homebrew, created by GitHub, or matching the following: Vampire/setup-wsl@, codecov/codecov-action@, google-github-actions/setup-gcloud@, peter-evans/, reitermarkus/, ruby/setup-ruby@, dessant/lock-threads@, google-github-actions/auth@, google-github-actions/get-gke-credentials@*.

MikeMcQuaid avatar Aug 08 '22 13:08 MikeMcQuaid

I see, thanks for the confirmation. Seems like I need to modify the composite action on the Homebrew actions repository.

mohzulfikar avatar Aug 08 '22 13:08 mohzulfikar

It seems like all checks have been successful. Any more feedback for this?

mohzulfikar avatar Aug 12 '22 10:08 mohzulfikar

It looks like we're successful here. I'll go ahead and merge, and we can watch it in regular use.

mistydemeo avatar Aug 16 '22 17:08 mistydemeo