|
20 | 20 | - name: Generate commit history and schedule |
21 | 21 | id: generate-commits |
22 | 22 | 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 |
64 | 25 |
|
65 | 26 | # Use a fixed branch name for the PR |
66 | 27 | - name: Update dev-to-master branch |
|
0 commit comments