update workflow

This commit is contained in:
Robin Appelman 2026-11-22 16:16:41 +01:00
commit 1053ab26b1

View file

@ -0,0 +1,56 @@
name: update
on:
workflow_dispatch:
inputs:
package:
description: "Update a single package"
required: false
default: ""
type: string
group:
description: "Update group"
required: false
default: ""
type: string
jobs:
docker:
runs-on: nix
steps:
- uses: actions/checkout@v7
- uses: https://codeberg.org/icewind/attic-action@v1
with:
name: link
instance: https://cache.icewind.link
authToken: "${{ secrets.ATTIC_TOKEN }}"
- name: Update package ${{ inputs.package }}
if: inputs.package != ''
run: |
NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1 nix-update --flake --use-update-script "${{ inputs.package }}"
- name: Update group ${{ inputs.group }}
if: inputs.group != ''
run: |
./update.nu ${{ inputs.group }}
- id: check_changed
name: Check any file has changed
run: |
git status --porcelain
if [ -n "$(git status --porcelain)" ]; then
echo "files have changed"
echo "outdated=true" >> $GITHUB_OUTPUT
else
echo "files haven't changed"
echo "outdated=false" >> $GITHUB_OUTPUT
fi
- name: Commit files
if: steps.check_changed.outputs.outdated == 'true'
run: |
git config --global user.email ""
git config --global user.name "updatebot"
git commit -m "Automated updates" -a
git push