run when failed like it needs #12
This file contains 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
on: | |
push: | |
paths: | |
- 'flake.lock' | |
jobs: | |
check: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
name: Check Flake outputs after flake update | |
outputs: | |
check-log: ${{ steps.flake-check.outputs.log }} | |
steps: | |
- name: Checkout | |
id: checkout | |
uses: actions/checkout@v3 | |
- name: Install Nix | |
id: install-nix | |
uses: cachix/install-nix-action@v30 | |
- name: Check Flake | |
id: flake-check | |
run: | | |
output=$(nix flake check 2&>1) | |
echo "log=$output" >> $GITHUB_OUTPUT | |
maybe_repair: | |
runs-on: ubuntu-latest | |
needs: check | |
if: ${{ always() }} | |
permissions: | |
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 | |
- name: Run GPT Prompt | |
uses: DukeLuo/[email protected] | |
env: | |
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
CHECK_LOG: ${{ needs.check.outputs.check-log }} | |
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: $CHECK_LOG\n" | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v5 | |
with: | |
branch: ai-flake-update-fixes | |
title: "flake-update: Fix options changed during flake update" | |
commit-message: "flake-update: Fix options changed in flake update" |