Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 27 additions & 11 deletions .github/workflows/update-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ name: Update 'ai/liquid.mdc' and 'data/latest.json' files

on:
workflow_dispatch:
push:
branches:
- main

jobs:
build:
Expand All @@ -29,17 +26,36 @@ jobs:
- name: Generate AI file
run: yarn generate:ai

- name: Run git config
run: |
git config user.name "GitHub Actions Bot"
git config user.email "<>"

- name: Commit and push changes
- name: Create Pull Request
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if [[ -n "$(git status --porcelain)" ]]; then
git add .
# Configure git
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"

# Create and switch to new branch
BRANCH_NAME="update-ai-docs-$(date +%Y%m%d-%H%M%S)"
git checkout -b "$BRANCH_NAME"

# Commit changes
git add ai/liquid.mdc
git add data/latest.json
git commit -m "Update 'ai/liquid.mdc' and 'data/latest.json' files"
git push origin main

# Push branch
git push origin "$BRANCH_NAME"

# Create pull request using GitHub CLI
gh pr create \
--title "Update 'ai/liquid.mdc' and 'data/latest.json' files" \
--body "Automated update of AI documentation and latest revision data.

- Updated \`ai/liquid.mdc\` with latest documentation
- Updated \`data/latest.json\` with current revision SHA" \
--base main \
--head "$BRANCH_NAME"
else
echo "No changes to commit"
fi