trigger source updates #250
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
# Scheduled action to update: | |
# - flake inputs of ./versions/ | |
# - rust-overlay flake input | |
# - nixpkgs flake input | |
name: "trigger source updates" | |
on: | |
# push: | |
# branches: [pr-periodic-updates] | |
schedule: | |
- cron: "0 */6 * * *" # run every 6 hours | |
workflow_dispatch: | |
inputs: | |
only-base-ref: | |
description: | | |
when this is set to 'true', the branches main and develop | |
will not be automatically included in the update | |
required: true | |
default: "false" | |
type: string | |
concurrency: | |
group: ${{ github.ref_name }} | |
jobs: | |
call-update: | |
strategy: | |
fail-fast: false | |
matrix: | |
branch: | |
- name: develop | |
skip: false | |
- name: ${{ github.ref_name }} | |
skip: true | |
update: | |
- source: "versions/0_1" | |
cmd: "nix run .#scripts-repo-flake-update 0_1" | |
- source: "versions/0_2" | |
cmd: "nix run .#scripts-repo-flake-update 0_2" | |
- source: "rust-overlay" | |
cmd: "nix flake lock --update-input rust-overlay" | |
- source: "nixpkgs" | |
cmd: "nix flake lock --update-input nixpkgs" | |
runs-on: "ubuntu-latest" | |
steps: | |
- name: Evaluate skip | |
id: skip | |
if: ${{ | |
!( | |
(github.event.inputs.only-base-ref == 'true' && !endsWith(github.ref_name, matrix.branch.name)) | |
|| (github.event.inputs.only-base-ref != 'true' && endsWith(github.ref_name, matrix.branch.name) && matrix.branch.skip == true) | |
) | |
}} | |
run: echo | |
- name: Checkout repository | |
if: ${{ steps.skip.outcome != 'skipped' }} | |
uses: actions/[email protected] | |
- name: Call the update action | |
if: ${{ steps.skip.outcome != 'skipped' }} | |
uses: ./.github/actions/update | |
with: | |
branch: ${{ matrix.branch.name }} | |
update_source: ${{ matrix.update.source }} | |
update_cmd: ${{ matrix.update.cmd }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
HRA_GITHUB_TOKEN: ${{ secrets.HRA_GITHUB_TOKEN }} | |
CACHIX_SIGNING_KEY: ${{ secrets.CACHIX_SIGNING_KEY }} | |
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }} | |
all-jobs-succeed: | |
runs-on: "ubuntu-latest" | |
needs: [call-update] | |
if: always() | |
steps: | |
- name: Check status | |
env: | |
RESULTS: "${{ toJSON(needs.*.result) }}" | |
run: "[[ $(jq -n 'env.RESULTS | fromjson | unique == [\"success\"]') == \"true\" ]]\n" |