(Cron) Synchronize upstream nixpkgs #21
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 nixpkgs | |
on: | |
workflow_dispatch: | |
schedule: | |
# Run this Action every 7 days at 0:00pm UTC | |
- cron: "0 0 */7 * *" | |
env: | |
OWNER: piyoki | |
TARGETS: | | |
nixpkgs | |
nixpkgs-small | |
home-manager | |
PR_LABELS: | | |
flake-lock | |
automated | |
GIT_COMMIT_MESSAGE: "chore(flake) update flake.lock for upstream nixpkgs" | |
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 }}" |