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

Update GitHub Actions for Homebrew Formula Automation #15

Merged
merged 25 commits into from
Sep 5, 2024
Merged

Conversation

nashdean
Copy link
Owner

@nashdean nashdean commented Sep 5, 2024

PR Description:

Summary: This PR updates the update-homebrew-formula.yaml workflow to improve the automation process for updating the Homebrew formula when a new release is published. The workflow has been enhanced to ensure the Homebrew formula is updated with the correct tarball URL, SHA256 checksum, and dependencies, and that changes are pushed back to the homebrew-dirmap repository automatically.

Key Changes:

Repository Checkout:

The homebrew-dirmap repository is now checked out directly using actions/checkout@v2. This eliminates the need for manually initializing and configuring the repository.
GitHub No-Reply Email:

To protect privacy, the workflow now uses GitHub’s no-reply email (12345678+username@users.noreply.github.com) for committing changes to the Homebrew formula, ensuring that the commit is still associated with the correct GitHub account without exposing personal email information.

Formula Update Process:

The workflow dynamically fetches the tarball URL and recalculates the SHA256 checksum for the new release. The dirmapper.rb formula file is then updated with this information, ensuring the Homebrew formula is always aligned with the latest version.

Commit and Push Changes:

After updating the formula file, the changes are committed and pushed back to the homebrew-dirmap repository’s master branch automatically.

Testing:

The workflow can now be manually triggered using workflow_dispatch with an input tag to test the updates without needing a new release.
A dry-run test was performed using a previous release tag to ensure the formula update logic works as expected.

Next Steps:

After merging this PR, the automated formula updates should work seamlessly with future releases of dirmap, ensuring the Homebrew tap is always up to date.

@nashdean
Copy link
Owner Author

nashdean commented Sep 5, 2024

I was getting the error below while testing this Github Actions -- specifically:

[master d2e2a94] Update dirmapper formula to 1 file changed, 16 insertions(+), 17 deletions(-) remote: Permission to nashdean/homebrew-dirmap.git denied to github-actions[bot]. fatal: unable to access '[https://github.com/nashdean/homebrew-dirmap/'](vscode-file://vscode-app/Applications/Visual%20Studio%20Code%202.app/Contents/Resources/app/out/vs/code/electron-sandbox/workbench/workbench.html): The requested URL returned error: 403 Error: Process completed with exit code 128.

After many failed attempts to fix it, this thread saved me thanks to @magodo's answer to set persist-credentials to false and fetch-depth to 0 in the checkout action.

Screenshot 2024-09-05 at 1 06 58 AM

@nashdean
Copy link
Owner Author

nashdean commented Sep 5, 2024

Added in a fix to be able to run homebrew to install dirmap now. A couple known bugs discovered and added to readme.

@nashdean nashdean merged commit 7c5dd35 into master Sep 5, 2024
1 check passed
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.

1 participant