Update Flake #18
This file contains hidden or 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: Update Flake | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "43 3 */10 * *" # run every ten days at 3:43 am | |
| env: | |
| BRANCH: auto/update-flake | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| update: | |
| name: "nix flake update" | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 | |
| - uses: DeterminateSystems/nix-installer-action@c5a866b6ab867e88becbed4467b93592bce69f8a # v21 | |
| - name: nix flake update | |
| run: | | |
| git config user.name 'github-actions[bot]' | |
| git config user.email 'github-actions[bot]@users.noreply.github.com' | |
| git branch -f ${BRANCH} origin/main | |
| git checkout ${BRANCH} | |
| nix flake update --commit-lock-file | |
| git push --force origin ${BRANCH} | |
| - name: "Create pull request" | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| if ! gh pr list --head ${BRANCH} --json number --base main | grep -q number; then | |
| gh pr create --base main --head ${BRANCH} --title "Update Flake" --body "" | |
| fi |