Skip to content

chore(deps): bump the production-minor-patch group across 1 directory with 6 updates #9

chore(deps): bump the production-minor-patch group across 1 directory with 6 updates

chore(deps): bump the production-minor-patch group across 1 directory with 6 updates #9

name: Complete Feature
# Automatically moves LLM history from active/ to completed/ when a PR is merged into develop.
on:
pull_request:
types: [closed]
branches: [develop]
# Prevent concurrent pushes to target branch - queue instead of cancel
concurrency:
group: push-${{ github.event.pull_request.base.ref }}
cancel-in-progress: false
jobs:
complete-history:
# Only run if PR was merged (not just closed)
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Generate GitHub App token
id: app-token
uses: actions/create-github-app-token@v3
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
- uses: actions/checkout@v7
with:
ref: ${{ github.event.pull_request.base.ref }}
fetch-depth: 0
token: ${{ steps.app-token.outputs.token }}
persist-credentials: false
- name: Extract feature name from branch
id: feature
run: |
BRANCH="${{ github.event.pull_request.head.ref }}"
# Extract feature name (remove prefix like feature/, fix/, etc.)
FEATURE_NAME=$(echo "$BRANCH" | sed 's|^[^/]*/||')
echo "name=$FEATURE_NAME" >> $GITHUB_OUTPUT
echo "branch=$BRANCH" >> $GITHUB_OUTPUT
- name: Check for LLM history
id: check
run: |
FEATURE_NAME="${{ steps.feature.outputs.name }}"
HISTORY_DIR=".llm/history/active/$FEATURE_NAME"
if [[ -d "$HISTORY_DIR" ]]; then
echo "found=true" >> $GITHUB_OUTPUT
echo "Found history directory: $HISTORY_DIR"
else
echo "found=false" >> $GITHUB_OUTPUT
echo "No LLM history found for feature: $FEATURE_NAME"
echo "This is normal if LLM assistance wasn't used."
fi
- name: Complete feature history
if: steps.check.outputs.found == 'true'
run: |
FEATURE_NAME="${{ steps.feature.outputs.name }}"
HISTORY_DIR=".llm/history/active/$FEATURE_NAME"
DATE=$(date +%Y-%m)
mkdir -p ".llm/history/completed/$DATE"
# Update completion date in all markdown files
for file in "$HISTORY_DIR"/*.md; do
if [[ -f "$file" ]]; then
sed -i "s/Completed: In Progress/Completed: $(date +%Y-%m-%d)/" "$file"
fi
done
# Move directory to completed
mv "$HISTORY_DIR" ".llm/history/completed/$DATE/"
echo "✓ Moved to .llm/history/completed/$DATE/$FEATURE_NAME/"
- name: Commit and push
if: steps.check.outputs.found == 'true'
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
# Configure remote URL with GitHub App token for authenticated push
git remote set-url origin https://x-access-token:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
git add .llm/history/
if git diff --staged --quiet; then
echo "No changes to commit"
else
git commit --no-verify -m "chore: complete LLM history for ${{ steps.feature.outputs.name }} [bot]"
# Pull latest changes (in case i18n workflow pushed)
git pull --rebase origin ${{ github.event.pull_request.base.ref }} || true
git push --no-verify origin ${{ github.event.pull_request.base.ref }}
fi