Repository navigation
Update Happy from stable release #242
This file contains hidden or 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 Happy from stable release | |
| on: | |
| schedule: | |
| - cron: "17 * * * *" | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: update-happy | |
| cancel-in-progress: false | |
| jobs: | |
| prepare: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| changed: ${{ steps.generate.outputs.changed }} | |
| steps: | |
| - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 | |
| - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 | |
| with: | |
| node-version: "24" | |
| - run: node --test scripts/*.test.mjs | |
| - name: Generate candidate from upstream stable release | |
| id: generate | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| node scripts/update-happy.mjs | |
| if git diff --quiet -- Casks/happy.rb; then | |
| echo 'changed=false' >> "$GITHUB_OUTPUT" | |
| else | |
| echo 'changed=true' >> "$GITHUB_OUTPUT" | |
| fi | |
| - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 | |
| if: steps.generate.outputs.changed == 'true' | |
| with: | |
| name: candidate-cask | |
| path: Casks/happy.rb | |
| if-no-files-found: error | |
| test: | |
| needs: prepare | |
| if: needs.prepare.outputs.changed == 'true' | |
| uses: ./.github/workflows/cask-test.yml | |
| with: | |
| candidate: true | |
| publish: | |
| needs: [prepare, test] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 | |
| - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4 | |
| with: | |
| name: candidate-cask | |
| path: Casks | |
| - name: Commit only the tested candidate | |
| run: | | |
| git config user.name 'github-actions[bot]' | |
| git config user.email '41898282+github-actions[bot]@users.noreply.github.com' | |
| git add Casks/happy.rb | |
| git commit -m "happy: update to tested stable release" | |
| git push origin HEAD:main | |
| echo 'Published the cask after install, boot, and uninstall checks passed.' >> "$GITHUB_STEP_SUMMARY" |