Automatically update nixpkgs #204
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} | |