Skip to content

Commit 5b1fc2c

Browse files
committed
ci: Allow releasing from any branch
1 parent 872656d commit 5b1fc2c

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

.github/workflows/check-deep-tests-reusable.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ on:
55
inputs:
66
sha:
77
type: string
8+
branch:
9+
type: string
810

911
jobs:
1012
check-deep-tests:
@@ -19,4 +21,7 @@ jobs:
1921
with:
2022
script: |
2123
const script = require('${{ github.workspace }}/dafny/.github/workflows/check-for-workflow-run.js')
22-
console.log(script({github, context, core}, workflowID = 'deep-tests.yml', branch = 'master', sha = '${{ inputs.sha }}'))
24+
console.log(script({github, context, core,
25+
workflow_id: 'deep-tests.yml',
26+
...('${{ inputs.sha }}' ? {sha: '${{ inputs.sha }}'} : {}),
27+
...('${{ inputs.branch }}' ? {branch: '${{ inputs.branch }}'} : {})}))

.github/workflows/check-for-workflow-run.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
// Check for a successful previous run of a workflow.
22
// This could make a decent reusable action itself.
3-
module.exports = async ({github, context, core}, workflowID, branch, sha = null) => {
3+
module.exports = async ({github, context, core, workflow_id, sha, ...config}) => {
44
// This API doesn't support filtering by SHA, so we just
55
// fetch the first page and scan manually.
66
// That means if the run is fairly old it may be missed,
77
// but that should be rare.
88
const result = await github.rest.actions.listWorkflowRuns({
99
owner: context.repo.owner,
1010
repo: context.repo.repo,
11-
branch,
12-
workflow_id: workflowID,
11+
workflow_id,
12+
...config
1313
})
1414
// These are ordered by creation time, so decide based on the first
1515
// run for this SHA we see.
16-
const runFilterDesc = sha ? `${workflowID} on ${sha}` : workflowID
16+
const runFilterDesc = sha ? `${workflow_id} on ${sha}` : workflow_id
1717
for (const run of result.data.workflow_runs) {
1818
if (!sha || run.head_sha == sha) {
1919
if (run.conclusion != "success") {

.github/workflows/msbuild.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ jobs:
5252

5353
check-deep-tests:
5454
uses: ./.github/workflows/check-deep-tests-reusable.yml
55+
with:
56+
branch: master
5557

5658
integration-tests:
5759
needs: check-deep-tests

0 commit comments

Comments
 (0)