-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
20 additions
and
9 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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: | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.