Skip to content

chore: sunshine-beta: rebuild bottles #1145

chore: sunshine-beta: rebuild bottles

chore: sunshine-beta: rebuild bottles #1145

---
name: Update Bug Report
permissions: {}
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
pull_request:
push:
branches:
- master
jobs:
update-formulas:
name: Update Formula List
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Scan for formulas
id: scan_formulas
run: |
echo "Scanning Formula directory for .rb files..."
# Find all .rb files in the Formula directory
formulas=$(find Formula -name "*.rb" -type f | sed 's|Formula/[^/]*/||; s|\.rb$||' | sort)
# Convert to JSON array format
json_array=$(echo "$formulas" | jq -R -s -c 'split("\n") | map(select(length > 0))')
echo "Found formulas: $json_array"
echo "formulas=$json_array" >> "${GITHUB_OUTPUT}"
- name: Update formulas dropdown
id: update_dropdown
uses: ShaMan123/gha-form-dropdown-options@124b08a39f06a6a4fcafdec501ecaca8db019db2 # v2.1.0
with:
form: .github/ISSUE_TEMPLATE/bug-report.yml
template: .github/t_bug-report.yml
dropdown: _formulas
options: ${{ steps.scan_formulas.outputs.formulas }}
dry_run: no-commit
- name: git diff
if: steps.update_dropdown.outputs.modified == 'true'
run: git diff --color
- name: Create/Update Pull Request
id: create-pr
if: |
steps.update_dropdown.outputs.modified == 'true' &&
github.event_name != 'pull_request'
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
with:
add-paths: |
.github/ISSUE_TEMPLATE/*.yml
token: ${{ secrets.GH_BOT_TOKEN }}
commit-message: "chore: Update formulas list in bug-report.yml"
branch: bot/update-formulas-list
delete-branch: true
title: "chore: Update formulas list in bug-report.yml"
body: |
This PR updates the list of formulas in the bug report issue template.
The list was automatically generated by scanning the Formula directory.
labels: |
auto-approve
auto-merge
- name: Automerge PR
env:
GH_TOKEN: ${{ secrets.GH_BOT_TOKEN }}
if: |
steps.create-pr.outputs.pull-request-number != '' &&
steps.update_dropdown.outputs.modified == 'true' &&
github.event_name != 'pull_request'
run: |
gh pr merge \
--auto \
--delete-branch \
--squash \
"${{ steps.create-pr.outputs.pull-request-number }}"