From d83584de92a8c468aea9e2d756cc2c7a734b2bc9 Mon Sep 17 00:00:00 2001 From: m32 Date: Fri, 13 Dec 2024 20:23:50 -0700 Subject: [PATCH] run when failed like it needs --- .github/workflows/update-check.yaml | 32 +++++++++++++++++++++-------- flake.lock | 6 +++--- 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/.github/workflows/update-check.yaml b/.github/workflows/update-check.yaml index 7e3f786..815c3e0 100644 --- a/.github/workflows/update-check.yaml +++ b/.github/workflows/update-check.yaml @@ -4,35 +4,49 @@ on: - 'flake.lock' jobs: check: - runs-on: ubuntu-latest + name: Check Flake outputs after flake update permissions: contents: read - name: Check Flake outputs after flake update + runs-on: ubuntu-latest outputs: - check-log: ${{ steps.flake-check.outputs.log }} + flake-check-stderr: ${{ steps.flake-check.outputs.OUT }} steps: - - name: Checkout + - name: Checkout Repo id: checkout uses: actions/checkout@v3 - name: Install Nix id: install-nix uses: cachix/install-nix-action@v30 - - name: Check Flake + - name: Run Flake Check id: flake-check + continue-on-error: true run: | - output=$(nix flake check) - echo "log=$output" >> $GITHUB_OUTPUT + { + echo $(nix flake check 2>&1) + } >> flake-check-stderr.txt + - name: Upload Flake Check Stderr + uses: actions/upload-artifact@v3 + with: + name: flake-check-stderr + path: flake-check-stderr.txt + maybe_repair: runs-on: ubuntu-latest needs: check permissions: - contents: read + contents: write pull-requests: write + if: ${{ always() }} name: Check for deprecated/renamed options in flake check and submit a pull request to fix if found steps: - name: Checkout id: checkout uses: actions/checkout@v3 + - name: Download Flake Check Stderr Artifact + uses: actions/download-artifact@v3 + with: + name: flake-check-stderr + path: ./ - name: Run GPT Prompt uses: DukeLuo/gpt-runner@v1.0.0 env: @@ -40,7 +54,7 @@ jobs: with: cmd: | promptr --model "gpt-4o" \ - --prompt "Please make fixes to any of the following issues with the flake check output included: [option renamed, option deprecated, option removed]. \n Flake Output: \n ${{ needs.jobs.check.outputs.check-log }}" + --prompt "Please make fixes to any of the issues found with the flake check output included in flake-check-stderr.txt" - name: Create Pull Request uses: peter-evans/create-pull-request@v5 with: diff --git a/flake.lock b/flake.lock index 9a821de..43c137e 100644 --- a/flake.lock +++ b/flake.lock @@ -703,11 +703,11 @@ "treefmt-nix": "treefmt-nix_2" }, "locked": { - "lastModified": 1734142061, - "narHash": "sha256-Ty/noNHJEnuz+7vl4U/8aIiBsFlmLSkMw0Me6xKSRTA=", + "lastModified": 1734146452, + "narHash": "sha256-aY6OIfq0eaP3aHqLJVGW942tOxrw/nmvMUoMWn6WySM=", "owner": "nix-community", "repo": "NUR", - "rev": "790ba51f04ffd55a391903408afde3790b472334", + "rev": "0a769f94417536b76c57010cb5d7b55af820d479", "type": "github" }, "original": {