From 1784e84b6b01c651d78d257de4aeebe54858734a Mon Sep 17 00:00:00 2001 From: seth Date: Wed, 12 Jun 2024 04:42:43 -0400 Subject: ci: cleanup update-flake.yaml --- .github/workflows/update-flake.yaml | 37 +++++++++++++++++++++++++++++++++++++ .github/workflows/update-lock.yaml | 30 ------------------------------ 2 files changed, 37 insertions(+), 30 deletions(-) create mode 100644 .github/workflows/update-flake.yaml delete mode 100644 .github/workflows/update-lock.yaml diff --git a/.github/workflows/update-flake.yaml b/.github/workflows/update-flake.yaml new file mode 100644 index 0000000..06b3a4d --- /dev/null +++ b/.github/workflows/update-flake.yaml @@ -0,0 +1,37 @@ +name: Update flake.lock + +on: + schedule: + # run every saturday + - cron: "0 0 * * 6" + workflow_dispatch: + +jobs: + update: + name: Run update + runs-on: ubuntu-latest + + permissions: + contents: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install Nix + uses: DeterminateSystems/nix-installer-action@v12 + + - name: Update flake.lock & make PR + uses: DeterminateSystems/update-flake-lock@v22 + id: update + with: + commit-msg: "nix: update flake.lock" + pr-title: "nix: update flake.lock" + token: ${{ secrets.MERGE_TOKEN }} + + - name: Enable auto-merge + if: env.PR_ID != '' + run: gh pr merge --auto --squash "$PR_ID" + env: + GH_TOKEN: ${{ github.token}} + PR_ID: ${{ steps.update.outputs.pull-request-number }} diff --git a/.github/workflows/update-lock.yaml b/.github/workflows/update-lock.yaml deleted file mode 100644 index ec24cd1..0000000 --- a/.github/workflows/update-lock.yaml +++ /dev/null @@ -1,30 +0,0 @@ -name: Update flake.lock - -on: - schedule: - # run every saturday at 0:00 utc - - cron: "0 0 * * 6" - workflow_dispatch: - -jobs: - update: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - - name: Install Nix - uses: DeterminateSystems/nix-installer-action@v12 - - - name: Update lockfile & make PR - uses: DeterminateSystems/update-flake-lock@v22 - id: update - with: - token: ${{ secrets.MERGE_TOKEN }} - - - name: Enable auto-merge - shell: bash - run: gh pr merge --auto --rebase "$PR_ID" - env: - GITHUB_TOKEN: ${{ secrets.MERGE_TOKEN }} - PR_ID: ${{ steps.update.outputs.pull-request-number }} -- cgit v1.2.3