Skip to content

nvcheck

nvcheck #5

Workflow file for this run

name: nvcheck
# Weekly safety net: if an upstream release is newer than a committed pkgver
# (e.g. a release dispatch was missed), fire the same aur-bump dispatch a
# release would. The primary update path is the release dispatch; this catches
# gaps.
on:
schedule:
- cron: '17 6 * * 1' # Mondays 06:17 UTC
workflow_dispatch:
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install nvchecker
run: pipx install nvchecker
- name: Query upstream versions
env:
GH_READ_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
printf '[keys]\ngithub = "%s"\n' "$GH_READ_TOKEN" > keyfile.toml
echo '{"version": 2, "data": {}}' > old_ver.json
nvchecker -c packages.toml
- name: Dispatch bumps for lagging packages
env:
GH_TOKEN: ${{ secrets.TAP_GITHUB_TOKEN }}
run: |
for dir in */; do
pkg=${dir%/}
[[ -f "$pkg/PKGBUILD" ]] || continue
latest=$(jq -r --arg k "$pkg" '.data[$k] // empty' new_ver.json)
[[ -n "$latest" ]] || { echo "$pkg: no upstream version found"; continue; }
current=$(sed -n 's/^pkgver=//p' "$pkg/PKGBUILD")
if [[ "$latest" != "$current" ]] && \
[[ "$(printf '%s\n%s\n' "$current" "$latest" | sort -V | tail -1)" == "$latest" ]]; then
echo "$pkg: $current -> $latest (dispatching aur-bump)"
gh api "repos/${GITHUB_REPOSITORY}/dispatches" \
-f event_type=aur-bump \
-f "client_payload[package]=$pkg" \
-f "client_payload[version]=$latest"
else
echo "$pkg: up to date ($current)"
fi
done