mirror of
https://codeberg.org/spire/nix.git
synced 2026-11-30 19:30:46 +01:00
update workflow
This commit is contained in:
parent
28375ca56d
commit
1053ab26b1
1 changed files with 56 additions and 0 deletions
56
.forgejo/workflows/update.yml
Normal file
56
.forgejo/workflows/update.yml
Normal 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
|
||||||
Loading…
Add table
Add a link
Reference in a new issue