-
Notifications
You must be signed in to change notification settings - Fork 56
42 lines (39 loc) · 1.29 KB
/
patch-pr.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
name: Patch PR
on:
pull_request:
paths:
- 'patches.nix'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
refresh-and-commit:
runs-on: ubuntu-latest
if: github.ref != 'refs/heads/master'
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v22
with:
nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v12
with:
name: fuellabs
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: nix run .#refresh-manifests
timeout-minutes: 120
- name: validate changed nix files
run: |
files=( $(git diff --name-only '*.nix') )
echo "${#files[*]} nix files changed: ${files[*]}"
if [[ "${#files[*]}" -ne 0 ]]; then
nix-instantiate --parse "${files[@]}" >/dev/null
fi
- uses: stefanzweifel/git-auto-commit-action@v5
with:
branch: ${{ github.ref_name }}
commit_message: 'ci: refresh manifests for patch PR'
file_pattern: 'manifests/*'