-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (39 loc) · 1.54 KB
/
auto-update-dev-tools.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
# On a schedule, this workflow checks whether new tool versions have been
# released. If so, this workflow runs `update-dev-tools.sh`, which updates the
# tool versions in the Dockerfile. It then opens and auto-merges an update PR.
name: dev-tools update
on:
schedule:
# run once, each monday+wednesday+friday, at 4AM PST (UTC-8:00)
- cron: '0 12 * * 1,3,5'
workflow_dispatch:
jobs:
create-pr:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v2
- name: update dockerfiles
run: src/update-dev-tools.sh
- name: run diff
run: git diff
- name: Create PR
uses: peter-evans/create-pull-request@v3
id: create-pr
with:
title: '[Auto] Update hlint and fourmolu image'
body: 'This PR should be approved once the latest HLS includes this fourmolu version.'
branch: auto/update-image
# Github won't run actions when triggered by a github token, intentional limitation.
# Their workaround is to use personal tokens, we use a purpose-made token for fossabot.
token: ${{ secrets.FOSSABOT_TOKEN }}
- name: Enable auto-merge
uses: peter-evans/enable-pull-request-automerge@v1
if: steps.create-pr.outputs.pull-request-operation == 'created'
with:
# Same reason as above
token: ${{ secrets.FOSSABOT_TOKEN }}
merge-method: squash
pull-request-number: ${{ steps.create-pr.outputs.pull-request-number }}