From a77ff80d2dcc275fc656b16e22ad0150bdffef63 Mon Sep 17 00:00:00 2001 From: Braelyn Boynton Date: Mon, 17 Feb 2025 12:39:18 -0800 Subject: [PATCH 1/2] fix llm txt workflow --- .github/workflows/compile-llms-txt.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/compile-llms-txt.yml b/.github/workflows/compile-llms-txt.yml index d2043861..9000f017 100644 --- a/.github/workflows/compile-llms-txt.yml +++ b/.github/workflows/compile-llms-txt.yml @@ -1,11 +1,12 @@ name: Compile llms.txt on: - push: + pull_request: branches: - main paths: - 'docs/**/*.mdx' + - 'docs/compile_llms_txt.py' jobs: compile: @@ -20,10 +21,10 @@ jobs: run: | cd docs python compile_llms_txt.py - - name: Commit and push changes - run: | - git config --local user.email "action@github.com" - git config --local user.name "GitHub Action" - git add docs/llms.txt - git commit -m "Update llms.txt" || exit 0 - git push + - name: Create Pull Request + uses: peter-evans/create-pull-request@v5 + with: + commit-message: Update llms.txt + title: 'Update llms.txt' + body: 'Auto-generated update to llms.txt based on docs changes' + branch: update-llms-txt \ No newline at end of file From e53938e1c6ad3532013f507e7fdf7b39d6e4cb55 Mon Sep 17 00:00:00 2001 From: Braelyn Boynton Date: Mon, 17 Feb 2025 13:43:03 -0800 Subject: [PATCH 2/2] commit to main --- .github/workflows/compile-llms-txt.yml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/compile-llms-txt.yml b/.github/workflows/compile-llms-txt.yml index 9000f017..c1338555 100644 --- a/.github/workflows/compile-llms-txt.yml +++ b/.github/workflows/compile-llms-txt.yml @@ -2,6 +2,8 @@ name: Compile llms.txt on: pull_request: + types: + - closed branches: - main paths: @@ -10,6 +12,8 @@ on: jobs: compile: + # Only run if the PR was merged (not just closed) + if: github.event.pull_request.merged == true runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -21,10 +25,10 @@ jobs: run: | cd docs python compile_llms_txt.py - - name: Create Pull Request - uses: peter-evans/create-pull-request@v5 - with: - commit-message: Update llms.txt - title: 'Update llms.txt' - body: 'Auto-generated update to llms.txt based on docs changes' - branch: update-llms-txt \ No newline at end of file + - name: Commit and push changes + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git add docs/llms.txt + git commit -m "Update llms.txt" || exit 0 + git push \ No newline at end of file