Allow inputs for workflow_* events, and propagate them through collections

This commit is contained in:
Michael B. Gale
2025-08-12 12:50:52 +01:00
parent cf7a5d3e11
commit a592f71173
64 changed files with 371 additions and 125 deletions

View File

@@ -20,8 +20,10 @@ on:
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {}
workflow_call: {}
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
jobs:
all-platform-bundle:
strategy:

View File

@@ -20,8 +20,10 @@ on:
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {}
workflow_call: {}
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
jobs:
analyze-ref-input:
strategy:

View File

@@ -20,8 +20,10 @@ on:
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {}
workflow_call: {}
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
jobs:
autobuild-action:
strategy:

View File

@@ -20,8 +20,10 @@ on:
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {}
workflow_call: {}
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
jobs:
autobuild-direct-tracing-with-working-dir:
strategy:

View File

@@ -20,8 +20,10 @@ on:
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {}
workflow_call: {}
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
jobs:
autobuild-direct-tracing:
strategy:

View File

@@ -20,8 +20,10 @@ on:
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {}
workflow_call: {}
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
jobs:
build-mode-autobuild:
strategy:

View File

@@ -20,8 +20,10 @@ on:
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {}
workflow_call: {}
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
jobs:
build-mode-manual:
strategy:

View File

@@ -20,8 +20,10 @@ on:
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {}
workflow_call: {}
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
jobs:
build-mode-none:
strategy:

View File

@@ -20,8 +20,10 @@ on:
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {}
workflow_call: {}
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
jobs:
build-mode-rollback:
strategy:

View File

@@ -20,8 +20,10 @@ on:
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {}
workflow_call: {}
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
jobs:
bundle-toolcache:
strategy:

View File

@@ -20,8 +20,10 @@ on:
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {}
workflow_call: {}
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
jobs:
bundle-zstd:
strategy:

View File

@@ -20,8 +20,10 @@ on:
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {}
workflow_call: {}
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
jobs:
cleanup-db-cluster-dir:
strategy:

View File

@@ -20,8 +20,10 @@ on:
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {}
workflow_call: {}
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
jobs:
config-export:
strategy:

View File

@@ -20,8 +20,10 @@ on:
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {}
workflow_call: {}
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
jobs:
config-input:
strategy:

View File

@@ -20,8 +20,10 @@ on:
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {}
workflow_call: {}
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
jobs:
cpp-deptrace-disabled:
strategy:

View File

@@ -20,8 +20,10 @@ on:
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {}
workflow_call: {}
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
jobs:
cpp-deptrace-enabled-on-macos:
strategy:

View File

@@ -20,8 +20,10 @@ on:
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {}
workflow_call: {}
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
jobs:
cpp-deptrace-enabled:
strategy:

View File

@@ -20,8 +20,10 @@ on:
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {}
workflow_call: {}
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
jobs:
diagnostics-export:
strategy:

View File

@@ -20,8 +20,10 @@ on:
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {}
workflow_call: {}
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
jobs:
export-file-baseline-information:
strategy:

View File

@@ -20,8 +20,10 @@ on:
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {}
workflow_call: {}
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
jobs:
extractor-ram-threads:
strategy:

View File

@@ -20,8 +20,18 @@ on:
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {}
workflow_call: {}
workflow_dispatch:
inputs:
go-version:
type: string
description: The version of Go to install
required: true
workflow_call:
inputs:
go-version:
type: string
description: The version of Go to install
required: true
jobs:
go-custom-queries:
strategy:
@@ -51,7 +61,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: '>=1.21.0'
go-version: ${{ inputs.go-version || '>=1.21.0' }}
cache: false
- uses: ./../action/init
with:

View File

@@ -20,8 +20,18 @@ on:
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {}
workflow_call: {}
workflow_dispatch:
inputs:
go-version:
type: string
description: The version of Go to install
required: true
workflow_call:
inputs:
go-version:
type: string
description: The version of Go to install
required: true
jobs:
go-indirect-tracing-workaround-diagnostic:
strategy:
@@ -49,7 +59,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: '>=1.21.0'
go-version: ${{ inputs.go-version || '>=1.21.0' }}
cache: false
- uses: ./../action/init
with:

View File

@@ -20,8 +20,18 @@ on:
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {}
workflow_call: {}
workflow_dispatch:
inputs:
go-version:
type: string
description: The version of Go to install
required: true
workflow_call:
inputs:
go-version:
type: string
description: The version of Go to install
required: true
jobs:
go-indirect-tracing-workaround-no-file-program:
strategy:
@@ -49,7 +59,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: '>=1.21.0'
go-version: ${{ inputs.go-version || '>=1.21.0' }}
cache: false
- name: Remove `file` program
run: |

View File

@@ -20,8 +20,18 @@ on:
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {}
workflow_call: {}
workflow_dispatch:
inputs:
go-version:
type: string
description: The version of Go to install
required: true
workflow_call:
inputs:
go-version:
type: string
description: The version of Go to install
required: true
jobs:
go-indirect-tracing-workaround:
strategy:
@@ -49,7 +59,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: '>=1.21.0'
go-version: ${{ inputs.go-version || '>=1.21.0' }}
cache: false
- uses: ./../action/init
with:

View File

@@ -20,8 +20,18 @@ on:
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {}
workflow_call: {}
workflow_dispatch:
inputs:
go-version:
type: string
description: The version of Go to install
required: true
workflow_call:
inputs:
go-version:
type: string
description: The version of Go to install
required: true
jobs:
go-tracing-autobuilder:
strategy:
@@ -79,7 +89,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: '>=1.21.0'
go-version: ${{ inputs.go-version || '>=1.21.0' }}
cache: false
- uses: ./../action/init
with:

View File

@@ -20,8 +20,18 @@ on:
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {}
workflow_call: {}
workflow_dispatch:
inputs:
go-version:
type: string
description: The version of Go to install
required: true
workflow_call:
inputs:
go-version:
type: string
description: The version of Go to install
required: true
jobs:
go-tracing-custom-build-steps:
strategy:
@@ -79,7 +89,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: '>=1.21.0'
go-version: ${{ inputs.go-version || '>=1.21.0' }}
cache: false
- uses: ./../action/init
with:

View File

@@ -20,8 +20,18 @@ on:
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {}
workflow_call: {}
workflow_dispatch:
inputs:
go-version:
type: string
description: The version of Go to install
required: true
workflow_call:
inputs:
go-version:
type: string
description: The version of Go to install
required: true
jobs:
go-tracing-legacy-workflow:
strategy:
@@ -79,7 +89,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: '>=1.21.0'
go-version: ${{ inputs.go-version || '>=1.21.0' }}
cache: false
- uses: ./../action/init
with:

21
.github/workflows/__go.yml generated vendored
View File

@@ -11,7 +11,12 @@ on:
push:
paths:
- .github/workflows/__go.yml
workflow_dispatch: {}
workflow_dispatch:
inputs:
go-version:
type: string
description: The version of Go to install
required: true
jobs:
go-custom-queries:
name: 'Go: Custom queries'
@@ -19,39 +24,53 @@ jobs:
contents: read
security-events: read
uses: ./.github/workflows/__go-custom-queries.yml
with:
go-version: ${{ inputs.go-version }}
go-tracing-legacy-workflow:
name: 'Go: tracing with legacy workflow'
permissions:
contents: read
security-events: read
uses: ./.github/workflows/__go-tracing-legacy-workflow.yml
with:
go-version: ${{ inputs.go-version }}
go-indirect-tracing-workaround:
name: 'Go: workaround for indirect tracing'
permissions:
contents: read
security-events: read
uses: ./.github/workflows/__go-indirect-tracing-workaround.yml
with:
go-version: ${{ inputs.go-version }}
go-tracing-custom-build-steps:
name: 'Go: tracing with custom build steps'
permissions:
contents: read
security-events: read
uses: ./.github/workflows/__go-tracing-custom-build-steps.yml
with:
go-version: ${{ inputs.go-version }}
go-tracing-autobuilder:
name: 'Go: tracing with autobuilder step'
permissions:
contents: read
security-events: read
uses: ./.github/workflows/__go-tracing-autobuilder.yml
with:
go-version: ${{ inputs.go-version }}
go-indirect-tracing-workaround-diagnostic:
name: 'Go: diagnostic when Go is changed after init step'
permissions:
contents: read
security-events: read
uses: ./.github/workflows/__go-indirect-tracing-workaround-diagnostic.yml
with:
go-version: ${{ inputs.go-version }}
go-indirect-tracing-workaround-no-file-program:
name: 'Go: diagnostic when `file` is not installed'
permissions:
contents: read
security-events: read
uses: ./.github/workflows/__go-indirect-tracing-workaround-no-file-program.yml
with:
go-version: ${{ inputs.go-version }}

View File

@@ -20,8 +20,10 @@ on:
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {}
workflow_call: {}
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
jobs:
init-with-registries:
strategy:

View File

@@ -20,8 +20,10 @@ on:
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {}
workflow_call: {}
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
jobs:
javascript-source-root:
strategy:

View File

@@ -20,8 +20,10 @@ on:
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {}
workflow_call: {}
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
jobs:
job-run-uuid-sarif:
strategy:

View File

@@ -20,8 +20,10 @@ on:
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {}
workflow_call: {}
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
jobs:
language-aliases:
strategy:

View File

@@ -20,8 +20,10 @@ on:
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {}
workflow_call: {}
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
jobs:
multi-language-autodetect:
strategy:

View File

@@ -20,8 +20,10 @@ on:
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {}
workflow_call: {}
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
jobs:
overlay-init-fallback:
strategy:

View File

@@ -20,8 +20,10 @@ on:
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {}
workflow_call: {}
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
jobs:
packaging-codescanning-config-inputs-js:
strategy:

View File

@@ -20,8 +20,10 @@ on:
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {}
workflow_call: {}
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
jobs:
packaging-config-inputs-js:
strategy:

View File

@@ -20,8 +20,10 @@ on:
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {}
workflow_call: {}
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
jobs:
packaging-config-js:
strategy:

View File

@@ -20,8 +20,10 @@ on:
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {}
workflow_call: {}
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
jobs:
packaging-inputs-js:
strategy:

View File

@@ -20,8 +20,10 @@ on:
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {}
workflow_call: {}
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
jobs:
quality-queries:
strategy:

View File

@@ -20,8 +20,10 @@ on:
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {}
workflow_call: {}
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
jobs:
remote-config:
strategy:

View File

@@ -20,8 +20,10 @@ on:
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {}
workflow_call: {}
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
jobs:
resolve-environment-action:
strategy:

View File

@@ -20,8 +20,10 @@ on:
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {}
workflow_call: {}
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
jobs:
rubocop-multi-language:
strategy:

6
.github/workflows/__ruby.yml generated vendored
View File

@@ -20,8 +20,10 @@ on:
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {}
workflow_call: {}
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
jobs:
ruby:
strategy:

6
.github/workflows/__rust.yml generated vendored
View File

@@ -20,8 +20,10 @@ on:
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {}
workflow_call: {}
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
jobs:
rust:
strategy:

View File

@@ -20,8 +20,10 @@ on:
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {}
workflow_call: {}
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
jobs:
split-workflow:
strategy:

View File

@@ -20,8 +20,10 @@ on:
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {}
workflow_call: {}
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
jobs:
start-proxy:
strategy:

View File

@@ -20,8 +20,10 @@ on:
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {}
workflow_call: {}
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
jobs:
submit-sarif-failure:
strategy:

View File

@@ -20,8 +20,10 @@ on:
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {}
workflow_call: {}
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
jobs:
swift-autobuild:
strategy:

View File

@@ -20,8 +20,10 @@ on:
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {}
workflow_call: {}
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
jobs:
swift-custom-build:
strategy:

View File

@@ -20,8 +20,10 @@ on:
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {}
workflow_call: {}
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
jobs:
test-autobuild-working-dir:
strategy:

View File

@@ -20,8 +20,10 @@ on:
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {}
workflow_call: {}
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
jobs:
test-local-codeql:
strategy:

6
.github/workflows/__test-proxy.yml generated vendored
View File

@@ -20,8 +20,10 @@ on:
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {}
workflow_call: {}
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
jobs:
test-proxy:
strategy:

View File

@@ -20,8 +20,10 @@ on:
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {}
workflow_call: {}
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
jobs:
unset-environment:
strategy:

View File

@@ -20,8 +20,10 @@ on:
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {}
workflow_call: {}
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
jobs:
upload-quality-sarif:
strategy:

View File

@@ -20,8 +20,10 @@ on:
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {}
workflow_call: {}
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
jobs:
upload-ref-sha-input:
strategy:

View File

@@ -20,8 +20,10 @@ on:
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {}
workflow_call: {}
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
jobs:
with-checkout-path:
strategy:

View File

@@ -1,6 +1,11 @@
name: "Go: Custom queries"
description: "Checks that Go works in conjunction with a config file specifying custom queries"
collection: go
inputs:
go-version:
type: string
description: "The version of Go to install"
required: true
operatingSystems:
- ubuntu
versions:

View File

@@ -1,11 +1,16 @@
name: "Go: diagnostic when Go is changed after init step"
description: "Checks that we emit a diagnostic if Go is changed after the init step"
collection: go
# only Linux is affected
operatingSystems: ["ubuntu"]
# pinned to a version which does not support statically linked binaries for indirect tracing
versions: ["default"]
installGo: "true"
collection: go
inputs:
go-version:
type: string
description: "The version of Go to install"
required: true
steps:
- uses: ./../action/init
with:

View File

@@ -1,11 +1,16 @@
name: "Go: diagnostic when `file` is not installed"
description: "Checks that we emit a diagnostic if the `file` program is not installed"
collection: go
# only Linux is affected
operatingSystems: ["ubuntu"]
# pinned to a version which does not support statically linked binaries for indirect tracing
versions: ["default"]
installGo: "true"
collection: go
inputs:
go-version:
type: string
description: "The version of Go to install"
required: true
steps:
- name: Remove `file` program
run: |

View File

@@ -1,11 +1,16 @@
name: "Go: workaround for indirect tracing"
description: "Checks that our workaround for indirect tracing for Go 1.21+ on Linux works"
collection: go
# only Linux is affected
operatingSystems: ["ubuntu"]
# pinned to a version which does not support statically linked binaries for indirect tracing
versions: ["default"]
installGo: "true"
collection: go
inputs:
go-version:
type: string
description: "The version of Go to install"
required: true
steps:
- uses: ./../action/init
with:

View File

@@ -1,6 +1,11 @@
name: "Go: tracing with autobuilder step"
description: "Checks that Go tracing works when using an autobuilder step"
collection: go
inputs:
go-version:
type: string
description: "The version of Go to install"
required: true
operatingSystems: ["ubuntu", "macos"]
env:
DOTNET_GENERATE_ASPNET_CERTIFICATE: "false"

View File

@@ -1,6 +1,11 @@
name: "Go: tracing with custom build steps"
description: "Checks that Go tracing traces the build when using custom build steps"
collection: go
inputs:
go-version:
type: string
description: "The version of Go to install"
required: true
operatingSystems: ["ubuntu", "macos"]
installGo: "true"
steps:

View File

@@ -1,6 +1,11 @@
name: "Go: tracing with legacy workflow"
description: "Checks that we run the autobuilder in legacy workflows with neither an autobuild step nor manual build steps"
collection: go
inputs:
go-version:
type: string
description: "The version of Go to install"
required: true
operatingSystems: ["ubuntu", "macos"]
env:
DOTNET_GENERATE_ASPNET_CERTIFICATE: "false"

View File

@@ -114,11 +114,16 @@ for file in (this_dir / 'checks').glob('*.yml'):
installGo = True if checkSpecification['installGo'].lower() == "true" else False
if installGo:
goVersionExpr = '>=1.21.0'
if 'inputs' in checkSpecification and 'go-version' in checkSpecification['inputs']:
goVersionExpr = '${{ inputs.go-version || \'>=1.21.0\' }}'
steps.append({
'name': 'Install Go',
'uses': 'actions/setup-go@v5',
'with': {
'go-version': '>=1.21.0',
'go-version': goVersionExpr,
# to avoid potentially misleading autobuilder results where we expect it to download
# dependencies successfully, but they actually come from a warm cache
'cache': False
@@ -169,6 +174,10 @@ for file in (this_dir / 'checks').glob('*.yml'):
'checkName': checkName
})
workflowInputs = {}
if 'inputs' in checkSpecification:
workflowInputs = checkSpecification['inputs']
raw_file = this_dir.parent / ".github" / "workflows" / f"__{checkName}.yml.raw"
with open(raw_file, 'w') as output_stream:
writeHeader(output_stream)
@@ -186,8 +195,12 @@ for file in (this_dir / 'checks').glob('*.yml'):
'types': ["opened", "synchronize", "reopened", "ready_for_review"]
},
'schedule': [{'cron': SingleQuotedScalarString('0 5 * * *')}],
'workflow_dispatch': {},
'workflow_call': {}
'workflow_dispatch': {
'inputs': workflowInputs
},
'workflow_call': {
'inputs': workflowInputs
}
},
'jobs': {
checkName: checkJob
@@ -203,10 +216,20 @@ for file in (this_dir / 'checks').glob('*.yml'):
# write workflow files for collections
for collection_name in collections:
jobs = {}
combinedInputs = {}
for check in collections[collection_name]:
checkName = check['checkName']
checkSpecification = check['specification']
checkInputs = {}
checkWith = {}
if 'inputs' in checkSpecification:
combinedInputs |= checkSpecification['inputs']
for inputName in checkSpecification['inputs'].keys():
checkWith[inputName] = "${{ inputs." + inputName + " }}"
jobs[checkName] = {
'name': checkSpecification['name'],
'permissions': {
@@ -214,6 +237,7 @@ for collection_name in collections:
'security-events': 'read'
},
'uses': "./.github/workflows/" + f"__{checkName}.yml",
'with': checkWith
}
raw_file = this_dir.parent / ".github" / "workflows" / f"__{collection_name}.yml.raw"
@@ -231,7 +255,9 @@ for collection_name in collections:
f'.github/workflows/__{collection_name}.yml'
]
},
'workflow_dispatch': {},
'workflow_dispatch': {
'inputs': combinedInputs
},
},
'jobs': jobs
}, output_stream)