-
-
Notifications
You must be signed in to change notification settings - Fork 7
51 lines (46 loc) · 1.68 KB
/
update.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
name: Automated update
on:
workflow_dispatch: # Allows triggering manually
schedule:
- cron: '47 14 * * 1' # runs every Monday at 14:47 UTC (chosen somewhat randomly)
pull_request:
jobs:
update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
path: repo
- uses: cachix/install-nix-action@V27
- name: Run update script
run: |
nix-build repo -A autoPrUpdate
result/bin/auto-pr-update repo > body
env:
GH_TOKEN: ${{ github.token }}
- name: Output result
if: ${{ github.event_name == 'pull_request' }}
run: |
{
cat body
echo ""
echo '```diff'
git -C repo diff
echo '```'
} > $GITHUB_STEP_SUMMARY
- name: Create Pull Request
if: ${{ github.event_name != 'pull_request' }}
uses: peter-evans/create-pull-request@v6
with:
# To trigger CI for automated PRs, we use a separate machine account
# See https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#workarounds-to-trigger-further-workflow-runs
# and https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#push-pull-request-branches-to-a-fork
token: ${{ secrets.MACHINE_USER_PAT }}
path: repo
push-to-fork: infinixbot/nixpkgs-check-by-name
committer: infinixbot <[email protected]>
author: infinixbot <[email protected]>
commit-message: "Automated update"
branch: auto-update
title: "Automated update"
body-path: body