diff --git a/.github/workflows/update-check.yaml b/.github/workflows/update-check.yaml index 7e3f786..340566d 100644 --- a/.github/workflows/update-check.yaml +++ b/.github/workflows/update-check.yaml @@ -8,8 +8,6 @@ jobs: permissions: contents: read name: Check Flake outputs after flake update - outputs: - check-log: ${{ steps.flake-check.outputs.log }} steps: - name: Checkout id: checkout @@ -20,27 +18,36 @@ jobs: - name: Check Flake id: flake-check run: | - output=$(nix flake check) - echo "log=$output" >> $GITHUB_OUTPUT + output=$(nix flake check 2>&1) + echo "flake-check-output=$output" >> $GITHUB_OUTPUT + - uses: actions/upload-artifact@v3 + with: + name: flake-check-output + path: flake-check-output.txt + maybe_repair: runs-on: ubuntu-latest needs: check permissions: - contents: read + contents: write pull-requests: write 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 + - uses: actions/download-artifact@v3 + with: + name: flake-check-output - name: Run GPT Prompt uses: DukeLuo/gpt-runner@v1.0.0 env: OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} with: cmd: | + flake_check_output=$(cat flake-check-output.txt) 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 following issues with the flake check output included: [option renamed, option deprecated, option removed]. \n Flake Output: $flake_check_output\n" - 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": {