24
24
jobs :
25
25
build :
26
26
name : Build and Test
27
- if : " !(github.event_name == 'pull_request' && github.event.pull_request.draft) && !(github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master') && !startsWith(github.event.head_commit.message, 'Version release')) "
27
+ if : ' !(github.event_name == '' pull_request'' && github.event.pull_request.draft) && !(github.event_name == '' push'' && (github.ref == '' refs/heads/main'' || github.ref == '' refs/heads/master'' ) && !startsWith(github.event.head_commit.message, '' Version release'' )) '
28
28
strategy :
29
29
matrix :
30
30
os : [ubuntu-latest]
55
55
- run : $SBT '++ ${{ matrix.scala }}' ci
56
56
57
57
- name : Compress target directories
58
- run : tar cf targets.tar target modules/jdbc/target modules/jdbc-testkit /target project/target
58
+ run : tar cf targets.tar target core /target project/target
59
59
60
60
- name : Upload target directories
61
61
uses : actions/upload-artifact@v3
@@ -110,7 +110,7 @@ jobs:
110
110
auto-merge :
111
111
name : Auto Merge
112
112
needs : [build]
113
- if : " github.event_name == 'pull_request' && contains(github.head_ref, 'version-bump') && contains(github.event.pull_request.labels.*.name, 'version: revision') "
113
+ if : ' github.event_name == '' pull_request'' && contains(github.head_ref, '' version-bump'' ) && contains(github.event.pull_request.labels.*.name, '' version: revision'' ) '
114
114
strategy :
115
115
matrix :
116
116
os : [ubuntu-latest]
@@ -123,11 +123,11 @@ jobs:
123
123
uses : actions/github-script@v6
124
124
with :
125
125
script : |
126
- github.rest.pulls.merge({
127
- owner: context.repo.owner,
128
- repo: context.repo.repo,
129
- pull_number: ${{ github.event.pull_request.number }},
130
- });
126
+ github.rest.pulls.merge({
127
+ owner: context.repo.owner,
128
+ repo: context.repo.repo,
129
+ pull_number: ${{ github.event.pull_request.number }},
130
+ });
131
131
github-token : ${{ secrets.PRECOG_GITHUB_TOKEN }}
132
132
133
133
check-labels :
@@ -143,8 +143,8 @@ jobs:
143
143
- name : Check PR labels
144
144
uses : docker://agilepathway/pull-request-label-checker:v1.4.30
145
145
with :
146
- one_of : " version: breaking,version: feature,version: revision,version: release"
147
- none_of : " :stop_sign:"
146
+ one_of : ' version: breaking,version: feature,version: revision,version: release'
147
+ none_of : ' :stop_sign:'
148
148
repo_token : ${{ env.GITHUB_TOKEN }}
149
149
150
150
next-version :
@@ -171,72 +171,72 @@ jobs:
171
171
uses : actions/github-script@v6
172
172
with :
173
173
script : |
174
- const currentVersion = '${{steps.current_version.outputs.CURRENT_VERSION}}'
175
- const parsedVersion = currentVersion.split(".")
176
- var major = Number(parsedVersion[0])
177
- var minor = Number(parsedVersion[1])
178
- var patch = Number(parsedVersion[2])
179
-
180
- const prResponse = await github.rest.repos.listPullRequestsAssociatedWithCommit({
181
- owner: context.repo.owner,
182
- repo: context.repo.repo,
183
- commit_sha: context.sha
184
- })
185
-
186
- const prs = prResponse.data
187
-
188
- if (prs === undefined) {
189
- throw new Error("Could not fetch PRs for commit: status " + prs.status)
190
- } else if (prs.length > 1) {
191
- throw new Error("Cannot determine version increment required as there is more than one PR associated with the commit: " + context.sha)
192
- } else if (prs.length === 0) {
193
- throw new Error("Cannot determine version increment required as there are no PRs associated with the commit: " + context.sha)
194
- }
195
-
196
- const pr = prs[0]
197
-
198
- for (const label of pr.labels) {
199
- if (label.name === 'version: revision') {
200
- patch = patch + 1
201
- break
202
- } else if (label.name === 'version: feature') {
203
- patch = 0
204
- minor = minor + 1
205
- break
206
- } else if (label.name === 'version: breaking') {
207
- major = major + 1
208
- minor = 0
209
- patch = 0
210
- break
211
- } else if (label.name === 'version: release') {
212
- major = major + 1
213
- minor = 0
214
- patch = 0
215
- break
216
- }
217
- }
218
-
219
- const nextVersion = major + '.' + minor + '.' + patch
220
-
221
- if (nextVersion === currentVersion) {
222
- throw new Error("Could not detect the version label on PR " + pr.number + " (obtained via association to commit " + context.sha + ")")
223
- }
224
-
225
- console.log("Setting the next version to " + nextVersion)
226
-
227
- var body = ""
228
- if (pr.body === undefined || pr.body === null || pr.body === "") {
229
- body = ""
230
- } else {
231
- body = "\n" + pr.body.replaceAll("\r\n", "\n")
232
- }
233
-
234
- // set outputs for
235
- const result = {
236
- nextVersion: nextVersion,
237
- commitMessage: "Version release: " + nextVersion + "\n\n" + pr.title + body
238
- }
239
- return result
174
+ const currentVersion = '${{steps.current_version.outputs.CURRENT_VERSION}}'
175
+ const parsedVersion = currentVersion.split(".")
176
+ var major = Number(parsedVersion[0])
177
+ var minor = Number(parsedVersion[1])
178
+ var patch = Number(parsedVersion[2])
179
+
180
+ const prResponse = await github.rest.repos.listPullRequestsAssociatedWithCommit({
181
+ owner: context.repo.owner,
182
+ repo: context.repo.repo,
183
+ commit_sha: context.sha
184
+ })
185
+
186
+ const prs = prResponse.data
187
+
188
+ if (prs === undefined) {
189
+ throw new Error("Could not fetch PRs for commit: status " + prs.status)
190
+ } else if (prs.length > 1) {
191
+ throw new Error("Cannot determine version increment required as there is more than one PR associated with the commit: " + context.sha)
192
+ } else if (prs.length === 0) {
193
+ throw new Error("Cannot determine version increment required as there are no PRs associated with the commit: " + context.sha)
194
+ }
195
+
196
+ const pr = prs[0]
197
+
198
+ for (const label of pr.labels) {
199
+ if (label.name === 'version: revision') {
200
+ patch = patch + 1
201
+ break
202
+ } else if (label.name === 'version: feature') {
203
+ patch = 0
204
+ minor = minor + 1
205
+ break
206
+ } else if (label.name === 'version: breaking') {
207
+ major = major + 1
208
+ minor = 0
209
+ patch = 0
210
+ break
211
+ } else if (label.name === 'version: release') {
212
+ major = major + 1
213
+ minor = 0
214
+ patch = 0
215
+ break
216
+ }
217
+ }
218
+
219
+ const nextVersion = major + '.' + minor + '.' + patch
220
+
221
+ if (nextVersion === currentVersion) {
222
+ throw new Error("Could not detect the version label on PR " + pr.number + " (obtained via association to commit " + context.sha + ")")
223
+ }
224
+
225
+ console.log("Setting the next version to " + nextVersion)
226
+
227
+ var body = ""
228
+ if (pr.body === undefined || pr.body === null || pr.body === "") {
229
+ body = ""
230
+ } else {
231
+ body = "\n" + pr.body.replaceAll("\r\n", "\n")
232
+ }
233
+
234
+ // set outputs for
235
+ const result = {
236
+ nextVersion: nextVersion,
237
+ commitMessage: "Version release: " + nextVersion + "\n\n" + pr.title + body
238
+ }
239
+ return result
240
240
241
241
- name : Modify version
242
242
id : modify_version
0 commit comments