-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (55 loc) · 2.08 KB
/
update-formulae.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# 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 }}"