mirror of
https://codeberg.org/spire/nix.git
synced 2026-11-30 03:20:47 +01:00
57 lines
1.6 KiB
YAML
57 lines
1.6 KiB
YAML
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://github.com/auscyber/celler-action@f39a2de27d00d1d82f4988d0877f1e494bf0afae
|
|
with:
|
|
cache: link
|
|
endpoint: https://cache.icewind.link
|
|
token: "${{ secrets.ATTIC_TOKEN }}"
|
|
skip-use: true
|
|
|
|
- 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: |
|
|
nix run .#update -- ${{ 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
|