Skip to content

Commit

Permalink
run when failed like it needs
Browse files Browse the repository at this point in the history
  • Loading branch information
NotM32 committed Dec 14, 2024
1 parent d6e4eb4 commit 6753cb6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
23 changes: 17 additions & 6 deletions .github/workflows/update-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -18,29 +16,42 @@ jobs:
id: install-nix
uses: cachix/install-nix-action@v30
- name: Check Flake
continue-on-error: true
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
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
- uses: actions/download-artifact@v3
with:
name: flake-check-output
- name: Run GPT Prompt
uses: DukeLuo/[email protected]
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: Remove artifiact
run: rm flake-check-output.txt
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
Expand Down
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6753cb6

Please sign in to comment.