File tree Expand file tree Collapse file tree 1 file changed +27
-11
lines changed Expand file tree Collapse file tree 1 file changed +27
-11
lines changed Original file line number Diff line number Diff line change @@ -2,9 +2,6 @@ name: Update 'ai/liquid.mdc' and 'data/latest.json' files
2
2
3
3
on :
4
4
workflow_dispatch :
5
- push :
6
- branches :
7
- - main
8
5
9
6
jobs :
10
7
build :
@@ -29,17 +26,36 @@ jobs:
29
26
- name : Generate AI file
30
27
run : yarn generate:ai
31
28
32
- - name : Run git config
33
- run : |
34
- git config user.name "GitHub Actions Bot"
35
- git config user.email "<>"
36
-
37
- - name : Commit and push changes
29
+ - name : Create Pull Request
30
+ env :
31
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
38
32
run : |
39
33
if [[ -n "$(git status --porcelain)" ]]; then
40
- git add .
34
+ # Configure git
35
+ git config user.name "github-actions[bot]"
36
+ git config user.email "github-actions[bot]@users.noreply.github.com"
37
+
38
+ # Create and switch to new branch
39
+ BRANCH_NAME="update-ai-docs-$(date +%Y%m%d-%H%M%S)"
40
+ git checkout -b "$BRANCH_NAME"
41
+
42
+ # Commit changes
43
+ git add ai/liquid.mdc
44
+ git add data/latest.json
41
45
git commit -m "Update 'ai/liquid.mdc' and 'data/latest.json' files"
42
- git push origin main
46
+
47
+ # Push branch
48
+ git push origin "$BRANCH_NAME"
49
+
50
+ # Create pull request using GitHub CLI
51
+ gh pr create \
52
+ --title "Update 'ai/liquid.mdc' and 'data/latest.json' files" \
53
+ --body "Automated update of AI documentation and latest revision data.
54
+
55
+ - Updated \`ai/liquid.mdc\` with latest documentation
56
+ - Updated \`data/latest.json\` with current revision SHA" \
57
+ --base main \
58
+ --head "$BRANCH_NAME"
43
59
else
44
60
echo "No changes to commit"
45
61
fi
You can’t perform that action at this time.
0 commit comments