-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (74 loc) · 2.73 KB
/
nvfetcher.yaml
File metadata and controls
84 lines (74 loc) · 2.73 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: Update nvfetcher
on:
workflow_dispatch: {}
schedule:
- cron: 0 3 * * *
push:
branches:
- main
paths:
- pkgs/nvfetcher.toml
jobs:
update-nvfetcher:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 0
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@c5a866b6ab867e88becbed4467b93592bce69f8a # v21
- name: Set up FlakeHub Cache
uses: DeterminateSystems/flakehub-cache-action@b346310c0af974cf01100bfb63602580e7f9f97a # v3
- name: Run nvfetcher
id: run-nvfetcher
run: |
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
cd pkgs
nix-shell -p nvfetcher --command 'nvfetcher -l /tmp/nvfetcher-changes --keep-old'
{
echo 'changes<<EOF'
cat /tmp/nvfetcher-changes
echo 'EOF'
} >> "$GITHUB_OUTPUT"
# - name: Update vendor hashes
# id: update-vendorhash
# run: |
# setHash () {
# jq --arg app "${1}" --arg hash "${2}" '.[$app] = $hash' pkgs/_sources/vendorhash.json > tmp.json
# mv tmp.json pkgs/_sources/vendorhash.json
# }
# declare -a APP_NAMES
# while read line; do
# APP_NAMES+=("${line%:*}")
# done < /tmp/nvfetcher-changes
# for APP_NAME in "${APP_NAMES[@]}"; do
# echo "Updating vendor hash for ${APP_NAME}..."
# setHash "${APP_NAME}" ""
# vendorHash=$(nix build --no-link .#${APP_NAME} 2>&1 >/dev/null | grep "got:" | cut -d':' -f2 | sed 's| ||g')
# if [[ -n "${vendorHash}" ]]; then
# setHash "${APP_NAME}" "${vendorHash}"
# echo "Updated ${APP_NAME} with vendorHash: ${vendorHash}"
# fi
# done
- name: Generate Token
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v3
id: app-token
with:
app-id: ${{ secrets.BOT_APP_ID }}
private-key: ${{ secrets.BOT_APP_PRIVATE_KEY }}
- name: Create Pull Request
id: create-pull-request
uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8
with:
token: ${{ steps.app-token.outputs.token }}
branch: nvfetcher/deps
title: "chore(deps): Update packages managed by nvfetcher"
commit-message: "chore(deps): Update packages managed by nvfetcher"
body: |
## Changes:
${{ steps.run-nvfetcher.outputs.changes }}
add-paths: |
pkgs/**
delete-branch: true