Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev-cmd/tap-new: various improvements #17110

Merged
merged 5 commits into from Apr 21, 2024
Merged

Conversation

ZhongRuoyu
Copy link
Member

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew typecheck with your changes locally?
  • Have you successfully run brew tests with your changes locally?

  1. Throw an error when tap is installed.
  2. Use actions/upload-artifact@v4 and actions/cache@v4.
  3. Fix GitHub Packages user; It should be github.repository_owner rather than github.actor.
  4. Unset GitHub Packages tokens if unused.
  5. Quote shell variables.

It should be `github.repository_owner` rather than `github.actor`.
1. Update `actions/cache` to `v4`.
2. Unset GitHub Packages tokens if unused.
3. Quote shell variables.
Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good once null question answered (or removed). Thanks!

Comment on lines 134 to 135
HOMEBREW_GITHUB_PACKAGES_TOKEN: #{args.github_packages? ? "${{ github.token }}" : "null"}
HOMEBREW_GITHUB_PACKAGES_USER: #{args.github_packages? ? "${{ github.repository_owner }}" : "null"}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the advantage in using null here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sort of similar to how fine-grained tokens are configured, I think it's preferred not to set an environment variable when it's not needed. Though, technically this should already have been restricted via the permissions above with packages: none.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is skill going to set the variable but just to a null value which seems weird. Nicer to make the output of both of these a single conditional perhaps?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is skill going to set the variable but just to a null value which seems weird.

It's actually null really, because it's interpreted as a YAML null.

Nicer to make the output of both of these a single conditional perhaps?

ea37708 should hopefully make it better by not setting those variables at all.

Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks @ZhongRuoyu!

@MikeMcQuaid MikeMcQuaid merged commit 2ab0af6 into master Apr 21, 2024
25 checks passed
@MikeMcQuaid MikeMcQuaid deleted the tap-new-improvements branch April 21, 2024 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants