Skip to content

Commit d9aac6b

Browse files
davila7claude
andcommitted
fix: update tracking workflow to create PRs instead of direct push
- Change workflow to create pull requests for tracking updates - Maintain repository security by requiring PR review - Add detailed PR descriptions with component information - Use GitHub CLI for automated PR creation 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 1e8b0be commit d9aac6b

File tree

1 file changed

+33
-3
lines changed

1 file changed

+33
-3
lines changed

.github/workflows/simple-tracking.yml

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,23 +115,53 @@ jobs:
115115
}
116116
"
117117
118-
- name: Commit and push changes
118+
- name: Create pull request with changes
119+
env:
120+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
119121
run: |
120122
git config --local user.email "action@github.com"
121123
git config --local user.name "GitHub Action"
122124
123125
if git diff --quiet docs/analytics/download-stats.json; then
124126
echo "📊 No changes to commit"
125127
else
128+
# Create a new branch for the tracking update
129+
BRANCH_NAME="tracking-update-$(date +%Y%m%d-%H%M%S)"
130+
git checkout -b "$BRANCH_NAME"
131+
126132
git add docs/analytics/download-stats.json
127133
git commit -m "📊 Track: ${{ github.event.inputs.component_type }}/${{ github.event.inputs.component_name }}
128134
129135
Auto-increment download counter
130136
131137
🤖 Automated via workflow_dispatch"
132138
133-
git push origin main
134-
echo "✅ Changes committed and pushed to main"
139+
git push origin "$BRANCH_NAME"
140+
141+
# Create pull request using GitHub CLI
142+
gh pr create \
143+
--title "📊 Download Tracking: ${{ github.event.inputs.component_type }}/${{ github.event.inputs.component_name }}" \
144+
--body "## Automated Download Tracking Update
145+
146+
**Component:** ${{ github.event.inputs.component_name }}
147+
**Type:** ${{ github.event.inputs.component_type }}
148+
**Platform:** ${{ github.event.inputs.platform }}
149+
**CLI Version:** ${{ github.event.inputs.cli_version }}
150+
151+
This PR automatically updates the download statistics based on component usage.
152+
153+
### Changes
154+
- 📊 Updated download counters in \`docs/analytics/download-stats.json\`
155+
- 📈 Incremented total downloads and type-specific counters
156+
- 🕒 Updated timestamp for real-time analytics
157+
158+
**Safe to merge** - This only updates analytics data.
159+
160+
🤖 Generated automatically by GitHub Actions" \
161+
--head "$BRANCH_NAME" \
162+
--base main
163+
164+
echo "✅ Pull request created successfully"
135165
fi
136166
137167
- name: Display updated stats

0 commit comments

Comments
 (0)