(Cron) Synchronize upstream flake inputs #54
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: (Cron) Synchronize upstream flake inputs | |
on: | |
workflow_dispatch: | |
schedule: | |
# Run this Action every 7 days at 0:00pm UTC | |
- cron: "0 0 */7 * *" | |
env: | |
OWNER: piyoki | |
TARGETS: | | |
pilots | |
chaotic | |
home-manager | |
sops-nix | |
nixpkgs-wayland | |
rust-nightly-overlay | |
neovim-nightly-overlay | |
impermanence | |
pre-commit-hooks | |
microvm | |
nix-fast-build | |
auto-cpufreq | |
PR_LABELS: | | |
flake-lock | |
automated | |
GIT_COMMIT_MESSAGE: "chore(flake) update flake.lock for the selected upstream inputs" | |
jobs: | |
sync-upstream: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Generate GitHub auth token | |
# https://github.com/tibdex/github-app-token | |
id: generate_token | |
uses: tibdex/[email protected] | |
with: | |
app_id: ${{ secrets.GH_APP_ID }} | |
private_key: ${{ secrets.GH_APP_PRIVATE_KEY }} | |
- uses: actions/checkout@main | |
with: | |
# ref: master | |
# submodules: true | |
token: ${{ steps.generate_token.outputs.token }} | |
- uses: DeterminateSystems/nix-installer-action@main | |
- uses: DeterminateSystems/magic-nix-cache-action@main | |
- uses: DeterminateSystems/flake-checker-action@main | |
- name: Update flake.lock | |
id: update-flake-lock | |
uses: DeterminateSystems/update-flake-lock@main | |
with: | |
pr-title: ${{ env.GIT_COMMIT_MESSAGE }} | |
pr-labels: ${{ env.PR_LABELS }} | |
inputs: ${{ env.TARGETS }} | |
token: ${{ steps.generate_token.outputs.token }} | |
pr-assignees: ${{ env.OWNER }} | |
- name: Print PR number | |
run: | | |
echo "Pull request number is ${{ steps.update-flake-lock.outputs.pull-request-number }}" |