Skip to content

Commit

Permalink
github-workflow: allow concurrency in reusable workflow call (#2215)
Browse files Browse the repository at this point in the history
  • Loading branch information
ollipa authored Apr 28, 2022
1 parent 66b4007 commit 31c11f6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
12 changes: 12 additions & 0 deletions src/schemas/json/github-workflow.json
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,18 @@
"$comment": "https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#jobsjob_idsecrets",
"description": "When a job is used to call a reusable workflow, you can use 'secrets' to provide a map of secrets that are passed to the called workflow. Any secrets that you pass must match the names defined in the called workflow.",
"$ref": "#/definitions/env"
},
"concurrency": {
"$comment": "https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idconcurrency",
"description": "Concurrency ensures that only a single job or workflow using the same concurrency group will run at a time. A concurrency group can be any string or expression. The expression can use any context except for the secrets context. \nYou can also specify concurrency at the workflow level. \nWhen a concurrent job or workflow is queued, if another job or workflow using the same concurrency group in the repository is in progress, the queued job or workflow will be pending. Any previously pending job or workflow in the concurrency group will be canceled. To also cancel any currently running job or workflow in the same concurrency group, specify cancel-in-progress: true.",
"oneOf": [
{
"type": "string"
},
{
"$ref": "#/definitions/concurrency"
}
]
}
},
"required": [
Expand Down
3 changes: 2 additions & 1 deletion src/test/github-workflow/call-reusable-workflow.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"uses": "exampleowner/example/.github/workflows/build_and_publish.yaml@v1",
"secrets": {
"api_token": "${{ secrets.API_TOKEN }}"
}
},
"concurrency": "build-${{ github.ref }}"
}
}
}

0 comments on commit 31c11f6

Please sign in to comment.