diff --git a/.github/workflows/nix-flake-update.yml b/.github/workflows/nix-flake-update.yml new file mode 100644 index 000000000..2745f5320 --- /dev/null +++ b/.github/workflows/nix-flake-update.yml @@ -0,0 +1,60 @@ +# Copyright 2024 RustFS Team +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: Update Nix Flake + +on: + workflow_dispatch: + schedule: + - cron: '0 0 * * 0' # Weekly on Sundays + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + update-flake: + name: Update flake.lock + runs-on: ubuntu-latest + timeout-minutes: 30 + permissions: + contents: write + pull-requests: write + steps: + - name: Checkout repository + uses: actions/checkout@v6 + + - name: Install Nix + uses: DeterminateSystems/determinate-nix-action@v3 + + - name: Check Nix flake inputs + uses: DeterminateSystems/flake-checker-action@v12 + + - name: Update flake.lock + id: update + uses: DeterminateSystems/update-flake-lock@main + with: + pr-title: "chore(deps): update flake.lock" + pr-labels: | + dependencies + nix + commit-msg: "chore(deps): update flake.lock" + + - name: Log PR details + if: steps.update.outputs.pull-request-number + run: | + echo "Pull Request created: ${{ steps.update.outputs.pull-request-number }}"