-
Notifications
You must be signed in to change notification settings - Fork 2
55 lines (54 loc) · 2.16 KB
/
niv-updater-nixpkgs.yml
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
name: Automatically update nixpkgs
on:
# Manual override, one can start the workflow by running:
# curl -H "Accept: application/vnd.github.everest-preview+json" \
# -H "Authorization: token <your-token-here>" \
# --request POST \
# --data '{"event_type": "niv-updater-nixpkgs-nudge", "client_payload": {}}' \
# https://api.github.com/repos/knl/dotskel/dispatches
#
# https://help.github.com/en/actions/reference/events-that-trigger-workflows#external-events-repository_dispatch
# If you need to debug the output, pass this data:
# '{"event_type": "niv-updater-nixpkgs-nudge", "client_payload": { "with_debug": true }}'
repository_dispatch:
types: niv-updater-nixpkgs-nudge
# this is to trigger the workflow manually from the Github page
workflow_dispatch:
inputs:
with_debug:
description: Enable debugging output
required: false
default: false
schedule:
# * is a special character in YAML so you have to quote this string
# Run every Monday at 01:17, but we use the dispatch to trigger when urgent
- cron: '17 01 * * 1'
jobs:
niv-updater:
name: 'Check for nixpkgs updates (weekly)'
runs-on: ubuntu-latest
steps:
- name: Set Variables
id: setvariables
run: |
shopt -s nocasematch
echo ${GITHUB_EVENT_NAME}
if [ ${GITHUB_EVENT_NAME} == 'workflow_dispatch' ];
then
echo "name=with_debug::${{ github.event.inputs.with_debug }}" >> $GITHUB_OUTPUT
elif [ ${GITHUB_EVENT_NAME} == 'repository_dispatch' ];
then
echo "name=with_debug::${{ github.event.client_payload.with_debug }}" >> $GITHUB_OUTPUT
else
echo "Unknown Event Trigger ${GITHUB_EVENT_NAME}, setting with_debug to false."
echo "name=with_debug::false" >> $GITHUB_OUTPUT
fi;
- name: niv-updater-action
uses: knl/niv-updater-action@main
with:
whitelist: 'nixpkgs'
keep_updating: true
branch_prefix: 'update/'
debug_output: ${{ steps.setvariables.outputs.with_debug }}
env:
GITHUB_TOKEN: ${{ secrets.NIV_UPDATER_TOKEN }}