Skip to content

Commit 29fdb4f

Browse files
committed
ci: clean up
1 parent 88dfd45 commit 29fdb4f

File tree

2 files changed

+39
-41
lines changed

2 files changed

+39
-41
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
COMMIT_LIST=$(git log --pretty=format:"* %s (%h) by %an" origin/master..dev |
2+
while IFS= read -r line; do
3+
if [[ ! $line =~ ^"* feat"* && ! $line =~ ^"* fix"* && ! $line =~ ^"* docs"* ]]; then
4+
echo "* chore${line:1}"
5+
else
6+
echo "$line"
7+
fi
8+
done)
9+
10+
if [ -z "$COMMIT_LIST" ]; then
11+
COMMIT_LIST="No new commits - branches may be identical"
12+
fi
13+
14+
MERGE_DATE="Friday"
15+
16+
echo "$COMMIT_LIST" >commit_list.txt
17+
18+
cat <<EOF >>$GITHUB_ENV
19+
PR_BODY<<EOT
20+
This is an automated PR to promote changes from \`dev\` to \`master\`.
21+
Please review and test before merging.
22+
23+
24+
See [TESTING.md](./TESTING.md) for complete testing instructions.
25+
26+
27+
According to our release policy, this PR is expected to be merged on: **$MERGE_DATE**
28+
Testers are encouraged to test the changes before merging.
29+
Please note that this schedule may be adjusted based on the needs of the project.
30+
31+
---
32+
$(cat commit_list.txt)
33+
---
34+
35+
Please review the changes carefully before merging.
36+
EOT
37+
EOF

.github/workflows/ci.yml

Lines changed: 2 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -20,47 +20,8 @@ jobs:
2020
- name: Generate commit history and schedule
2121
id: generate-commits
2222
run: |
23-
# Get the commit history between master and dev in conventional commit format
24-
COMMIT_LIST=$(git log --pretty=format:"* %s (%h) by %an" origin/master..dev |
25-
while IFS= read -r line; do
26-
if [[ ! $line =~ ^"* feat"* && ! $line =~ ^"* fix"* && ! $line =~ ^"* docs"* ]]; then
27-
echo "* chore${line:1}"
28-
else
29-
echo "$line"
30-
fi
31-
done)
32-
33-
# Handle empty commit list (branches are identical)
34-
if [ -z "$COMMIT_LIST" ]; then
35-
COMMIT_LIST="No new commits - branches may be identical"
36-
fi
37-
38-
# Calculate suggested merge date based on release policy
39-
# By default, suggesting next Monday as merge date - adjust according to your policy
40-
MERGE_DATE="Friday"
41-
42-
# Save commit list to a file (to handle multi-line output)
43-
echo "$COMMIT_LIST" > commit_list.txt
44-
45-
# Create a PR body with the commit list and suggested merge date
46-
echo "PR_BODY<<EOF" >> $GITHUB_ENV
47-
echo "This is an automated PR to promote changes from \`dev\` to \`master\`." >> $GITHUB_ENV
48-
echo "Please review and test before merging." >> $GITHUB_ENV
49-
echo "" >> $GITHUB_ENV
50-
echo "## For Testers" >> $GITHUB_ENV
51-
echo "See [TESTING.md](./TESTING.md) for complete testing instructions." >> $GITHUB_ENV
52-
echo "" >> $GITHUB_ENV
53-
echo "## Suggested Merge Schedule" >> $GITHUB_ENV
54-
echo "According to our release policy, this PR is expected to be merged on: **$MERGE_DATE**" >> $GITHUB_ENV
55-
echo "Testers are encouraged to test the changes before merging." >> $GITHUB_ENV
56-
echo "Please note that this schedule may be adjusted based on the needs of the project." >> $GITHUB_ENV
57-
echo "## Commits to be merged:" >> $GITHUB_ENV
58-
echo "---" >> $GITHUB_ENV
59-
cat commit_list.txt >> $GITHUB_ENV
60-
echo "---" >> $GITHUB_ENV
61-
echo "" >> $GITHUB_ENV
62-
echo "Please review the changes carefully before merging." >> $GITHUB_ENV
63-
echo "EOF" >> $GITHUB_ENV
23+
chmod +x .github/scripts/promote_to_master.sh
24+
.github/scripts/promote_to_master.sh
6425
6526
# Use a fixed branch name for the PR
6627
- name: Update dev-to-master branch

0 commit comments

Comments
 (0)