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 d09556f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
25 changes: 16 additions & 9 deletions .github/workflows/update-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,37 @@ 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 "OUT<<EOF"
nix flake check 2>&1
echo -e "\n"
echo "EOF"
} >> $GITHUB_OUTPUT
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
Expand All @@ -40,7 +47,7 @@ jobs:
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. \n Flake Output: ${{ needs.check.outputs.flake-check-stderr }}"
- 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 d09556f

Please sign in to comment.