Update #366
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 | |
on: | |
push: | |
branches: | |
- master | |
paths: | |
- '.github/**' | |
schedule: | |
- cron: "0 11 * * *" | |
workflow_dispatch: | |
permissions: | |
contents: write | |
jobs: | |
update: | |
name: Update Versions | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-go@v5 | |
with: | |
cache: false | |
- name: Run scripts/update_formula.php | |
run: php scripts/update_formula.php | |
- name: Commit changes. | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
set -x | |
go install github.com/planetscale/ghcommit@latest | |
if ! git diff --quiet Formula/tideways-php@*; then | |
changed_files=() | |
for f in Formula/tideways-php@*; do | |
changed_files+=(--add "$f") | |
done | |
ghcommit -r ${{ github.repository }} \ | |
-b master \ | |
"${changed_files[@]}" \ | |
--message "Update to tideways-php $(awk '$1 == "version"{gsub(/"/,"",$2); print $2}' ${changed_files[1]})" | |
git pull --autostash | |
fi | |
if ! git diff --quiet Formula/tideways-daemon.rb; then | |
ghcommit -r ${{ github.repository }} \ | |
-b master \ | |
--add Formula/tideways-daemon.rb \ | |
--message "Update to tideways-daemon $(awk '$1 == "version"{gsub(/"/,"",$2); print $2}' Formula/tideways-daemon.rb)" | |
git pull --autostash | |
fi | |
if ! git diff --quiet Formula/tideways-cli.rb; then | |
ghcommit -r ${{ github.repository }} \ | |
-b master \ | |
--add Formula/tideways-cli.rb \ | |
--message "Update to tideways-cli $(awk '$1 == "version"{gsub(/"/,"",$2); print $2}' Formula/tideways-cli.rb)" | |
git pull --autostash | |
fi |