Update Godot Casks #400
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update Godot Casks | |
on: | |
schedule: | |
- cron: '0 */6 * * *' # runs every 6 hours | |
workflow_dispatch: | |
jobs: | |
update-casks: | |
runs-on: macos-latest | |
permissions: | |
contents: write | |
pull-requests: write | |
steps: | |
- name: Create GitHub App Token | |
uses: actions/create-github-app-token@v1 | |
id: generate-token | |
with: | |
app-id: ${{ secrets.APP_ID }} | |
private-key: ${{ secrets.APP_PRIVATE_KEY }} | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # ensure full history for versioning | |
- name: Setup Homebrew | |
uses: Homebrew/actions/setup-homebrew@master | |
- name: Run update_casks.rb | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
brew update | |
brew tap fractalcounty/homebrew-godot-dev | |
ruby update_casks.rb | |
- name: Create pull request | |
id: create-pr | |
uses: peter-evans/create-pull-request@v7 | |
with: | |
token: ${{ steps.generate-token.outputs.token }} | |
commit-message: 'Updated to latest godot-build releases' | |
title: 'Update latest Godot build releases' | |
body: | | |
This PR updates the latest Godot development builds from the [godot-builds](https://github.com/godotengine/godot-builds/releases) repository. | |
**Note:** Only one `godot-dev` cask can be installed at a time to prevent conflicts with the CLI tool. | |
delete-branch: true | |
sign-commits: true # disable if auth issues show up | |
- name: Auto-merge PR | |
env: | |
GITHUB_APP_TOKEN: ${{ steps.generate-token.outputs.token }} | |
run: | | |
echo "${GITHUB_APP_TOKEN}" | gh auth login --with-token | |
PR_NUMBER=${{ steps.create-pr.outputs.pull-request-number }} | |
if [ -n "$PR_NUMBER" ]; then | |
gh pr merge "$PR_NUMBER" --merge --auto | |
echo "PR #$PR_NUMBER has been successfully merged." | |
else | |
echo "No Pull Request found to merge." | |
fi |