EPMRPP-116848 || Added launch owner #16
Workflow file for this run
This file contains hidden or 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
| # Copyright 2026 EPAM Systems | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, software | |
| # distributed under the License is distributed on an "AS IS" BASIS, | |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| # See the License for the specific language governing permissions and | |
| # limitations under the License. | |
| name: Regenerate llms.txt | |
| on: | |
| pull_request: | |
| types: [opened, synchronize] | |
| paths: | |
| - 'docs/**' | |
| - 'scripts/gen-llms.js' | |
| - '.github/workflows/gen-llms.yml' | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| regenerate: | |
| if: | | |
| github.event_name == 'workflow_dispatch' || | |
| (github.event_name == 'pull_request' && | |
| vars.LLMS_MANUAL != 'true' && | |
| github.event.pull_request.head.repo.full_name == github.repository) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Resolve target branch | |
| id: target | |
| env: | |
| EVENT_NAME: ${{ github.event_name }} | |
| PR_HEAD_REF: ${{ github.event.pull_request.head.ref }} | |
| run: | | |
| if [ "$EVENT_NAME" = "workflow_dispatch" ]; then | |
| echo "ref=develop" >> "$GITHUB_OUTPUT" | |
| else | |
| printf 'ref=%s\n' "$PR_HEAD_REF" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ steps.target.outputs.ref }} | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Regenerate llms.txt and ai-sitemap.json | |
| run: node ./scripts/gen-llms.js | |
| - name: Commit regenerated files | |
| env: | |
| TARGET_REF: ${{ steps.target.outputs.ref }} | |
| run: | | |
| git add static/llms.txt static/ai-sitemap.json | |
| if git diff --cached --quiet -- static/llms.txt static/ai-sitemap.json; then | |
| echo "No changes to llms.txt or ai-sitemap.json — skipping commit." | |
| exit 0 | |
| fi | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git commit -m "chore: regenerate llms.txt and ai-sitemap.json" | |
| git push origin "HEAD:$TARGET_REF" |