Repository navigation
58 lines (58 loc) · 2.28 KB
/
Copy pathupdate.yml
File metadata and controls
58 lines (58 loc) · 2.28 KB
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
name: "Update"
on:
workflow_dispatch:
schedule:
# chosen by fair dice rolling
- cron: '40 * * * *'
push:
branches:
- main
concurrency:
group: update
cancel-in-progress: false
jobs:
update_nur:
runs-on: ubuntu-latest
# Don't trigger when the last push was done by a bot
if: github.event_name != 'push' || !endsWith(github.actor, '[bot]')
steps:
- id: get_workflow_token
uses: peter-murray/workflow-application-token-action@d17e3a9a36850ea89f35db16c1067dd2b68ee343 # v4.0.1
with:
application_id: '${{ secrets.GH_APPLICATION_ID }}'
application_private_key: '${{ secrets.GH_APPLICATION_PRIVATE_KEY }}'
permissions: "contents:write"
revoke_token: true
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
- uses: cachix/install-nix-action@fd24c48048070c1be9acd18c9d369a83f0fe94d7 # v31
with:
nix_path: nixpkgs=channel:nixos-unstable
extra_nix_config: |
experimental-features = nix-command flakes
- name: update nur / nur-combined
run: ./ci/update-nur.sh
env:
API_TOKEN_GITHUB: '${{ steps.get_workflow_token.outputs.token }}'
- name: rebase # TODO: fix upstream push-protected to retry when push fails
run: |
source ./ci/lib/setup-git.sh
git fetch origin ${{ github.event.repository.default_branch }}
git pull --rebase origin ${{ github.event.repository.default_branch }}
env:
GITHUB_TOKEN: ${{ steps.get_workflow_token.outputs.token }}
- uses: CasperWA/push-protected@74d25b8aa10e0c29024138735d32f3c0b75f9279 # v2
with:
token: ${{ steps.get_workflow_token.outputs.token }}
branch: ${{ github.event.repository.default_branch }}
- name: Dispatch NUR-combined update
uses: peter-evans/repository-dispatch@5fc4efd1a4797ddb68ffd0714a238564e4cc0e6f # v4
with:
token: ${{ steps.get_workflow_token.outputs.token }}
repository: nix-community/nur-combined
event-type: nur_update
- name: Dispatch NUR-search update
uses: peter-evans/repository-dispatch@5fc4efd1a4797ddb68ffd0714a238564e4cc0e6f # v4
with:
token: ${{ steps.get_workflow_token.outputs.token }}
repository: nix-community/nur-search
event-type: nur_update