Skip to content

run when failed like it needs #15

run when failed like it needs

run when failed like it needs #15

Workflow file for this run

on:
push:
paths:
- 'flake.lock'
jobs:
check:
runs-on: ubuntu-latest
permissions:
contents: read
name: Check Flake outputs after flake update
steps:
- name: Checkout Repo
id: checkout
uses: actions/checkout@v3
- name: Install Nix
id: install-nix
uses: cachix/install-nix-action@v30
- name: Run Flake Check
id: flake-check
continue-on-error: true
run: |
output=$(nix flake check 2>&1)
echo $output >> flake-check-output.txt
- 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: 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 issues found with the flake check output included. \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:
branch: ai-flake-update-fixes
title: "flake-update: Fix options changed during flake update"
commit-message: "flake-update: Fix options changed in flake update"