File tree Expand file tree Collapse file tree 3 files changed +36
-15
lines changed Expand file tree Collapse file tree 3 files changed +36
-15
lines changed Original file line number Diff line number Diff line change 79
79
80
80
permissions :
81
81
contents : write
82
+ pull-requests : write
82
83
83
84
needs : [tag, compute-version, localazy]
84
85
steps :
@@ -102,3 +103,14 @@ jobs:
102
103
sha,
103
104
});
104
105
console.log(`Created branch ${branch} from ${sha}`);
106
+
107
+ - name : Open a pull request to merge the branch into main
108
+ env :
109
+ VERSION : ${{ needs.compute-version.outputs.short }}
110
+ run : |
111
+ gh pr create \
112
+ --title "Release branch $VERSION" \
113
+ --body "This pull request was automatically created by the release workflow. It merges the release branch back to main." \
114
+ --base main \
115
+ --head "release/v$VERSION" \
116
+ --label "T-Task"
Original file line number Diff line number Diff line change @@ -54,17 +54,38 @@ jobs:
54
54
secrets :
55
55
BOT_GITHUB_TOKEN : ${{ secrets.BOT_GITHUB_TOKEN }}
56
56
57
- merge-back :
58
- name : Open a pull request to merge the release branch back to main
57
+ update-branch :
58
+ name : Update the release branch
59
59
runs-on : ubuntu-22.04
60
60
61
61
permissions :
62
62
pull-requests : write
63
63
64
64
needs : [tag, compute-version]
65
- if : github.event.inputs.merge-back
66
65
steps :
66
+ - name : Update the release branch
67
+ uses : actions/github-script@v7.0.1
68
+ env :
69
+ BRANCH : " ${{ github.ref_name }}"
70
+ SHA : ${{ needs.tag.outputs.sha }}
71
+ with :
72
+ github-token : ${{ secrets.BOT_GITHUB_TOKEN }}
73
+ script : |
74
+ const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/');
75
+ const branch = process.env.BRANCH;
76
+ const sha = process.env.SHA;
77
+ const ref = `refs/heads/${branch}`;
78
+
79
+ await github.rest.git.updateRef({
80
+ owner,
81
+ repo,
82
+ ref,
83
+ sha,
84
+ });
85
+ console.log(`Updated branch ${branch} to ${sha}`);
86
+
67
87
- name : Open a pull request to merge the release branch back to main
88
+ if : github.event.inputs.merge-back
68
89
env :
69
90
VERSION : ${{ needs.compute-version.outputs.version }}
70
91
run : |
Original file line number Diff line number Diff line change 46
46
working-directory : tools/syn2mas
47
47
run : npm version "${{ inputs.version }}" --no-git-tag-version
48
48
49
- - name : Re-format package.json with biome
50
- working-directory : tools/syn2mas
51
- run : npx biome format --write package.json
52
-
53
49
- name : Commit and tag using the GitHub API
54
50
uses : actions/github-script@v7.0.1
55
51
id : commit
@@ -142,11 +138,3 @@ jobs:
142
138
sha: tagSha,
143
139
});
144
140
console.log("Created tag ref:", tag.data.url);
145
-
146
- const ref = await github.rest.git.updateRef({
147
- owner,
148
- repo,
149
- ref: `heads/${branch}`,
150
- sha: commit,
151
- });
152
- console.log("Updated branch ref:", ref.data.url);
You can’t perform that action at this time.
0 commit comments