Skip to content

Update formulae

Update formulae #398

# yamllint disable rule:line-length
name: Update formulae
on:
# Trigger once per day to check formulae referencing other repositories
schedule:
- cron: "0 6 * * *"
# Trigger on command source file changes
push:
branches:
- main
paths:
- Bin/*
# Allow manually triggering this workflow
workflow_dispatch:
jobs:
update:
runs-on: ubuntu-latest
steps:
# Check out the full repository history in order to determine the correct
# latest commit hashes for files versioned in this repository. By default
# the checkout action will only fetch the latest commit:
# https://github.com/actions/checkout/tree/v2#Fetch-all-history-for-all-tags-and-branches
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Update formulae
id: update-formulae
run: |
output=$(Scripts/update-formulae | sed -r 's/^/- /')
output="${output//'%'/'%25'}"
output="${output//$'\n'/'%0A'}"
output="${output//$'\r'/'%0D'}"
echo "::set-output name=changes::$output"
- name: Create or update pull-request
id: create-pull-request-action
uses: peter-evans/create-pull-request@v4
with:
branch: workflows/update-formulae
delete-branch: true
commit-message: |
Update formulae
${{ steps.update-formulae.outputs.changes }}
title: Update formulae
body: |
Updates to the formulae in this repository
${{ steps.update-formulae.outputs.changes }}
Auto-generated by the [update-formulae][1] workflow
[1]: https://github.com/pmeinhardt/homebrew-tools/blob/main/.github/workflows/update-formulae.yml
reviewers: pmeinhardt
labels: automated pull request
- name: Print pull-request details
run: echo "${{ steps.create-pull-request-action.outputs.pull-request-operation }} ${{ steps.create-pull-request-action.outputs.pull-request-url }}"