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 d83584d
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 12 deletions.
32 changes: 23 additions & 9 deletions .github/workflows/update-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,43 +4,57 @@ 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/[email protected]
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
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:
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 d83584d

Please sign in to comment.