update-flake-lock-inputs #140
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-lock-inputs | |
| on: | |
| workflow_dispatch: # allows manual triggering | |
| inputs: | |
| templates: | |
| description: 'Template paths (e.g., [ "tmpl1", "tmpl2"])' | |
| required: true | |
| flake_inputs: | |
| description: 'Flake inputs to update (e.g., ["inp1", "inp2"])' | |
| required: true | |
| jobs: | |
| lockfile: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| template: ${{ fromJson(github.event.inputs.templates) }} | |
| input: ${{ fromJson(github.event.inputs.flake_inputs) }} | |
| steps: | |
| - name: Generate token | |
| id: generate_token | |
| uses: actions/create-github-app-token@v2.2.1 | |
| with: | |
| app-id: ${{ secrets.BOT_APP_ID }} | |
| private-key: ${{ secrets.BOT_PRIVATE_KEY }} | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - uses: DeterminateSystems/determinate-nix-action@v3.8.2 | |
| with: | |
| extra-config: accept-flake-config = true | |
| - name: Update ${{ matrix.template }} flake.lock ${{ matrix.input }} | |
| uses: DeterminateSystems/update-flake-lock@v28 | |
| with: | |
| path-to-flake-dir: ${{ matrix.template }} | |
| commit-msg: "build(${{ matrix.template }}): Bump flake.lock ${{ matrix.input }}" | |
| pr-title: "Update ${{ matrix.template }} flake.lock ${{ matrix.input }}" | |
| pr-labels: | | |
| dependencies | |
| automated | |
| token: ${{ steps.generate_token.outputs.token }} | |
| branch: "update_${{ matrix.template }}_flake_lock_${{ matrix.input }}_action" | |
| inputs: ${{ matrix.input }} | |
| - name: Send notification on failure | |
| if: ${{ failure() }} | |
| uses: actions-cool/issues-helper@v3 | |
| with: | |
| actions: create-issue | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| title: Update of ${{ matrix.template }} ${{ matrix.input }} failure | |
| body: The [${{ github.workflow }}](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) workflow failed. Check the workflow run for details. | |
| labels: automated |