From bd79bc6b674fab3c0d7f700dfc5d87d81523977e Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Thu, 14 Aug 2025 11:50:03 +0100 Subject: [PATCH] Automatically add `go-version` input if `installGo == true` --- .github/workflows/__all-platform-bundle.yml | 16 +++++++++--- .github/workflows/__analyze-ref-input.yml | 16 +++++++++--- .github/workflows/__build-mode-manual.yml | 16 +++++++++--- .../__export-file-baseline-information.yml | 16 +++++++++--- .github/workflows/__go-custom-queries.yml | 6 +++-- ...indirect-tracing-workaround-diagnostic.yml | 6 +++-- ...ect-tracing-workaround-no-file-program.yml | 6 +++-- .../__go-indirect-tracing-workaround.yml | 6 +++-- .../workflows/__go-tracing-autobuilder.yml | 6 +++-- .../__go-tracing-custom-build-steps.yml | 6 +++-- .../__go-tracing-legacy-workflow.yml | 6 +++-- .github/workflows/__go.yml | 3 ++- .../workflows/__multi-language-autodetect.yml | 16 +++++++++--- ...ackaging-codescanning-config-inputs-js.yml | 16 +++++++++--- .../__packaging-config-inputs-js.yml | 16 +++++++++--- .github/workflows/__packaging-config-js.yml | 16 +++++++++--- .github/workflows/__packaging-inputs-js.yml | 16 +++++++++--- .github/workflows/__remote-config.yml | 16 +++++++++--- .github/workflows/__split-workflow.yml | 16 +++++++++--- .github/workflows/__swift-custom-build.yml | 16 +++++++++--- .github/workflows/__test-local-codeql.yml | 16 +++++++++--- .github/workflows/__unset-environment.yml | 16 +++++++++--- .github/workflows/__upload-quality-sarif.yml | 16 +++++++++--- .github/workflows/__upload-ref-sha-input.yml | 16 +++++++++--- .github/workflows/__with-checkout-path.yml | 16 +++++++++--- pr-checks/checks/go-custom-queries.yml | 5 ---- ...indirect-tracing-workaround-diagnostic.yml | 5 ---- ...ect-tracing-workaround-no-file-program.yml | 5 ---- .../checks/go-indirect-tracing-workaround.yml | 5 ---- pr-checks/checks/go-tracing-autobuilder.yml | 5 ---- .../checks/go-tracing-custom-build-steps.yml | 5 ---- .../checks/go-tracing-legacy-workflow.yml | 5 ---- pr-checks/sync.py | 25 +++++++++++-------- 33 files changed, 265 insertions(+), 112 deletions(-) diff --git a/.github/workflows/__all-platform-bundle.yml b/.github/workflows/__all-platform-bundle.yml index 9686e1e93..45407c57b 100644 --- a/.github/workflows/__all-platform-bundle.yml +++ b/.github/workflows/__all-platform-bundle.yml @@ -21,9 +21,19 @@ on: schedule: - cron: '0 5 * * *' workflow_dispatch: - inputs: {} + inputs: + go-version: + type: string + description: The version of Go to install + required: false + default: '>=1.21.0' workflow_call: - inputs: {} + inputs: + go-version: + type: string + description: The version of Go to install + required: false + default: '>=1.21.0' jobs: all-platform-bundle: 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 - id: init uses: ./../action/init diff --git a/.github/workflows/__analyze-ref-input.yml b/.github/workflows/__analyze-ref-input.yml index e094376da..5e03f4992 100644 --- a/.github/workflows/__analyze-ref-input.yml +++ b/.github/workflows/__analyze-ref-input.yml @@ -21,9 +21,19 @@ on: schedule: - cron: '0 5 * * *' workflow_dispatch: - inputs: {} + inputs: + go-version: + type: string + description: The version of Go to install + required: false + default: '>=1.21.0' workflow_call: - inputs: {} + inputs: + go-version: + type: string + description: The version of Go to install + required: false + default: '>=1.21.0' jobs: analyze-ref-input: strategy: @@ -55,7 +65,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: diff --git a/.github/workflows/__build-mode-manual.yml b/.github/workflows/__build-mode-manual.yml index 7461d160f..efec3292b 100644 --- a/.github/workflows/__build-mode-manual.yml +++ b/.github/workflows/__build-mode-manual.yml @@ -21,9 +21,19 @@ on: schedule: - cron: '0 5 * * *' workflow_dispatch: - inputs: {} + inputs: + go-version: + type: string + description: The version of Go to install + required: false + default: '>=1.21.0' workflow_call: - inputs: {} + inputs: + go-version: + type: string + description: The version of Go to install + required: false + default: '>=1.21.0' jobs: build-mode-manual: 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 id: init diff --git a/.github/workflows/__export-file-baseline-information.yml b/.github/workflows/__export-file-baseline-information.yml index 1c4424159..411a0c701 100644 --- a/.github/workflows/__export-file-baseline-information.yml +++ b/.github/workflows/__export-file-baseline-information.yml @@ -21,9 +21,19 @@ on: schedule: - cron: '0 5 * * *' workflow_dispatch: - inputs: {} + inputs: + go-version: + type: string + description: The version of Go to install + required: false + default: '>=1.21.0' workflow_call: - inputs: {} + inputs: + go-version: + type: string + description: The version of Go to install + required: false + default: '>=1.21.0' jobs: export-file-baseline-information: strategy: @@ -55,7 +65,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 id: init diff --git a/.github/workflows/__go-custom-queries.yml b/.github/workflows/__go-custom-queries.yml index b72c8cfdf..a8b0658a6 100644 --- a/.github/workflows/__go-custom-queries.yml +++ b/.github/workflows/__go-custom-queries.yml @@ -25,13 +25,15 @@ on: go-version: type: string description: The version of Go to install - required: true + required: false + default: '>=1.21.0' workflow_call: inputs: go-version: type: string description: The version of Go to install - required: true + required: false + default: '>=1.21.0' jobs: go-custom-queries: strategy: diff --git a/.github/workflows/__go-indirect-tracing-workaround-diagnostic.yml b/.github/workflows/__go-indirect-tracing-workaround-diagnostic.yml index 8e07fb91a..554bf86e1 100644 --- a/.github/workflows/__go-indirect-tracing-workaround-diagnostic.yml +++ b/.github/workflows/__go-indirect-tracing-workaround-diagnostic.yml @@ -25,13 +25,15 @@ on: go-version: type: string description: The version of Go to install - required: true + required: false + default: '>=1.21.0' workflow_call: inputs: go-version: type: string description: The version of Go to install - required: true + required: false + default: '>=1.21.0' jobs: go-indirect-tracing-workaround-diagnostic: strategy: diff --git a/.github/workflows/__go-indirect-tracing-workaround-no-file-program.yml b/.github/workflows/__go-indirect-tracing-workaround-no-file-program.yml index fd0a8a6c8..6af7dce43 100644 --- a/.github/workflows/__go-indirect-tracing-workaround-no-file-program.yml +++ b/.github/workflows/__go-indirect-tracing-workaround-no-file-program.yml @@ -25,13 +25,15 @@ on: go-version: type: string description: The version of Go to install - required: true + required: false + default: '>=1.21.0' workflow_call: inputs: go-version: type: string description: The version of Go to install - required: true + required: false + default: '>=1.21.0' jobs: go-indirect-tracing-workaround-no-file-program: strategy: diff --git a/.github/workflows/__go-indirect-tracing-workaround.yml b/.github/workflows/__go-indirect-tracing-workaround.yml index f6fd460a8..5e6b4e8a2 100644 --- a/.github/workflows/__go-indirect-tracing-workaround.yml +++ b/.github/workflows/__go-indirect-tracing-workaround.yml @@ -25,13 +25,15 @@ on: go-version: type: string description: The version of Go to install - required: true + required: false + default: '>=1.21.0' workflow_call: inputs: go-version: type: string description: The version of Go to install - required: true + required: false + default: '>=1.21.0' jobs: go-indirect-tracing-workaround: strategy: diff --git a/.github/workflows/__go-tracing-autobuilder.yml b/.github/workflows/__go-tracing-autobuilder.yml index 8590ea26f..f761175d9 100644 --- a/.github/workflows/__go-tracing-autobuilder.yml +++ b/.github/workflows/__go-tracing-autobuilder.yml @@ -25,13 +25,15 @@ on: go-version: type: string description: The version of Go to install - required: true + required: false + default: '>=1.21.0' workflow_call: inputs: go-version: type: string description: The version of Go to install - required: true + required: false + default: '>=1.21.0' jobs: go-tracing-autobuilder: strategy: diff --git a/.github/workflows/__go-tracing-custom-build-steps.yml b/.github/workflows/__go-tracing-custom-build-steps.yml index b27c5af5e..e06136080 100644 --- a/.github/workflows/__go-tracing-custom-build-steps.yml +++ b/.github/workflows/__go-tracing-custom-build-steps.yml @@ -25,13 +25,15 @@ on: go-version: type: string description: The version of Go to install - required: true + required: false + default: '>=1.21.0' workflow_call: inputs: go-version: type: string description: The version of Go to install - required: true + required: false + default: '>=1.21.0' jobs: go-tracing-custom-build-steps: strategy: diff --git a/.github/workflows/__go-tracing-legacy-workflow.yml b/.github/workflows/__go-tracing-legacy-workflow.yml index 1c3ef823e..f81fd1698 100644 --- a/.github/workflows/__go-tracing-legacy-workflow.yml +++ b/.github/workflows/__go-tracing-legacy-workflow.yml @@ -25,13 +25,15 @@ on: go-version: type: string description: The version of Go to install - required: true + required: false + default: '>=1.21.0' workflow_call: inputs: go-version: type: string description: The version of Go to install - required: true + required: false + default: '>=1.21.0' jobs: go-tracing-legacy-workflow: strategy: diff --git a/.github/workflows/__go.yml b/.github/workflows/__go.yml index ea2f1b1d8..6694c0bfb 100644 --- a/.github/workflows/__go.yml +++ b/.github/workflows/__go.yml @@ -16,7 +16,8 @@ on: go-version: type: string description: The version of Go to install - required: true + required: false + default: '>=1.21.0' jobs: go-custom-queries: name: 'Go: Custom queries' diff --git a/.github/workflows/__multi-language-autodetect.yml b/.github/workflows/__multi-language-autodetect.yml index 9c8b82fc6..5a56f8bdb 100644 --- a/.github/workflows/__multi-language-autodetect.yml +++ b/.github/workflows/__multi-language-autodetect.yml @@ -21,9 +21,19 @@ on: schedule: - cron: '0 5 * * *' workflow_dispatch: - inputs: {} + inputs: + go-version: + type: string + description: The version of Go to install + required: false + default: '>=1.21.0' workflow_call: - inputs: {} + inputs: + go-version: + type: string + description: The version of Go to install + required: false + default: '>=1.21.0' jobs: multi-language-autodetect: strategy: @@ -81,7 +91,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 id: init diff --git a/.github/workflows/__packaging-codescanning-config-inputs-js.yml b/.github/workflows/__packaging-codescanning-config-inputs-js.yml index d65d542eb..77fc03049 100644 --- a/.github/workflows/__packaging-codescanning-config-inputs-js.yml +++ b/.github/workflows/__packaging-codescanning-config-inputs-js.yml @@ -21,9 +21,19 @@ on: schedule: - cron: '0 5 * * *' workflow_dispatch: - inputs: {} + inputs: + go-version: + type: string + description: The version of Go to install + required: false + default: '>=1.21.0' workflow_call: - inputs: {} + inputs: + go-version: + type: string + description: The version of Go to install + required: false + default: '>=1.21.0' jobs: packaging-codescanning-config-inputs-js: strategy: @@ -67,7 +77,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: diff --git a/.github/workflows/__packaging-config-inputs-js.yml b/.github/workflows/__packaging-config-inputs-js.yml index 61a58b74e..37000d14f 100644 --- a/.github/workflows/__packaging-config-inputs-js.yml +++ b/.github/workflows/__packaging-config-inputs-js.yml @@ -21,9 +21,19 @@ on: schedule: - cron: '0 5 * * *' workflow_dispatch: - inputs: {} + inputs: + go-version: + type: string + description: The version of Go to install + required: false + default: '>=1.21.0' workflow_call: - inputs: {} + inputs: + go-version: + type: string + description: The version of Go to install + required: false + default: '>=1.21.0' jobs: packaging-config-inputs-js: strategy: @@ -67,7 +77,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: diff --git a/.github/workflows/__packaging-config-js.yml b/.github/workflows/__packaging-config-js.yml index 022eb3bf5..c96bfd784 100644 --- a/.github/workflows/__packaging-config-js.yml +++ b/.github/workflows/__packaging-config-js.yml @@ -21,9 +21,19 @@ on: schedule: - cron: '0 5 * * *' workflow_dispatch: - inputs: {} + inputs: + go-version: + type: string + description: The version of Go to install + required: false + default: '>=1.21.0' workflow_call: - inputs: {} + inputs: + go-version: + type: string + description: The version of Go to install + required: false + default: '>=1.21.0' jobs: packaging-config-js: strategy: @@ -67,7 +77,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: diff --git a/.github/workflows/__packaging-inputs-js.yml b/.github/workflows/__packaging-inputs-js.yml index 0e222c170..9ba7503de 100644 --- a/.github/workflows/__packaging-inputs-js.yml +++ b/.github/workflows/__packaging-inputs-js.yml @@ -21,9 +21,19 @@ on: schedule: - cron: '0 5 * * *' workflow_dispatch: - inputs: {} + inputs: + go-version: + type: string + description: The version of Go to install + required: false + default: '>=1.21.0' workflow_call: - inputs: {} + inputs: + go-version: + type: string + description: The version of Go to install + required: false + default: '>=1.21.0' jobs: packaging-inputs-js: strategy: @@ -67,7 +77,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: diff --git a/.github/workflows/__remote-config.yml b/.github/workflows/__remote-config.yml index 2128c1ed0..4a3fd0eff 100644 --- a/.github/workflows/__remote-config.yml +++ b/.github/workflows/__remote-config.yml @@ -21,9 +21,19 @@ on: schedule: - cron: '0 5 * * *' workflow_dispatch: - inputs: {} + inputs: + go-version: + type: string + description: The version of Go to install + required: false + default: '>=1.21.0' workflow_call: - inputs: {} + inputs: + go-version: + type: string + description: The version of Go to install + required: false + default: '>=1.21.0' jobs: remote-config: strategy: @@ -53,7 +63,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: diff --git a/.github/workflows/__split-workflow.yml b/.github/workflows/__split-workflow.yml index b3a430c96..869db0745 100644 --- a/.github/workflows/__split-workflow.yml +++ b/.github/workflows/__split-workflow.yml @@ -21,9 +21,19 @@ on: schedule: - cron: '0 5 * * *' workflow_dispatch: - inputs: {} + inputs: + go-version: + type: string + description: The version of Go to install + required: false + default: '>=1.21.0' workflow_call: - inputs: {} + inputs: + go-version: + type: string + description: The version of Go to install + required: false + default: '>=1.21.0' jobs: split-workflow: strategy: @@ -61,7 +71,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: diff --git a/.github/workflows/__swift-custom-build.yml b/.github/workflows/__swift-custom-build.yml index d14bfd0eb..0d3e92740 100644 --- a/.github/workflows/__swift-custom-build.yml +++ b/.github/workflows/__swift-custom-build.yml @@ -21,9 +21,19 @@ on: schedule: - cron: '0 5 * * *' workflow_dispatch: - inputs: {} + inputs: + go-version: + type: string + description: The version of Go to install + required: false + default: '>=1.21.0' workflow_call: - inputs: {} + inputs: + go-version: + type: string + description: The version of Go to install + required: false + default: '>=1.21.0' jobs: swift-custom-build: strategy: @@ -55,7 +65,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 id: init diff --git a/.github/workflows/__test-local-codeql.yml b/.github/workflows/__test-local-codeql.yml index 4f92de612..417515dfd 100644 --- a/.github/workflows/__test-local-codeql.yml +++ b/.github/workflows/__test-local-codeql.yml @@ -21,9 +21,19 @@ on: schedule: - cron: '0 5 * * *' workflow_dispatch: - inputs: {} + inputs: + go-version: + type: string + description: The version of Go to install + required: false + default: '>=1.21.0' workflow_call: - inputs: {} + inputs: + go-version: + type: string + description: The version of Go to install + required: false + default: '>=1.21.0' jobs: test-local-codeql: 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 - name: Fetch a CodeQL bundle shell: bash diff --git a/.github/workflows/__unset-environment.yml b/.github/workflows/__unset-environment.yml index 83d758ab2..772ac35b0 100644 --- a/.github/workflows/__unset-environment.yml +++ b/.github/workflows/__unset-environment.yml @@ -21,9 +21,19 @@ on: schedule: - cron: '0 5 * * *' workflow_dispatch: - inputs: {} + inputs: + go-version: + type: string + description: The version of Go to install + required: false + default: '>=1.21.0' workflow_call: - inputs: {} + inputs: + go-version: + type: string + description: The version of Go to install + required: false + default: '>=1.21.0' jobs: unset-environment: strategy: @@ -53,7 +63,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 id: init diff --git a/.github/workflows/__upload-quality-sarif.yml b/.github/workflows/__upload-quality-sarif.yml index 278bd581d..d122d4086 100644 --- a/.github/workflows/__upload-quality-sarif.yml +++ b/.github/workflows/__upload-quality-sarif.yml @@ -21,9 +21,19 @@ on: schedule: - cron: '0 5 * * *' workflow_dispatch: - inputs: {} + inputs: + go-version: + type: string + description: The version of Go to install + required: false + default: '>=1.21.0' workflow_call: - inputs: {} + inputs: + go-version: + type: string + description: The version of Go to install + required: false + default: '>=1.21.0' jobs: upload-quality-sarif: strategy: @@ -55,7 +65,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: diff --git a/.github/workflows/__upload-ref-sha-input.yml b/.github/workflows/__upload-ref-sha-input.yml index 73fb97c30..b991e7d36 100644 --- a/.github/workflows/__upload-ref-sha-input.yml +++ b/.github/workflows/__upload-ref-sha-input.yml @@ -21,9 +21,19 @@ on: schedule: - cron: '0 5 * * *' workflow_dispatch: - inputs: {} + inputs: + go-version: + type: string + description: The version of Go to install + required: false + default: '>=1.21.0' workflow_call: - inputs: {} + inputs: + go-version: + type: string + description: The version of Go to install + required: false + default: '>=1.21.0' jobs: upload-ref-sha-input: strategy: @@ -55,7 +65,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: diff --git a/.github/workflows/__with-checkout-path.yml b/.github/workflows/__with-checkout-path.yml index 93fc4b680..223d37642 100644 --- a/.github/workflows/__with-checkout-path.yml +++ b/.github/workflows/__with-checkout-path.yml @@ -21,9 +21,19 @@ on: schedule: - cron: '0 5 * * *' workflow_dispatch: - inputs: {} + inputs: + go-version: + type: string + description: The version of Go to install + required: false + default: '>=1.21.0' workflow_call: - inputs: {} + inputs: + go-version: + type: string + description: The version of Go to install + required: false + default: '>=1.21.0' jobs: with-checkout-path: strategy: @@ -55,7 +65,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: Delete original checkout shell: bash diff --git a/pr-checks/checks/go-custom-queries.yml b/pr-checks/checks/go-custom-queries.yml index 54466b033..4eeabfd71 100644 --- a/pr-checks/checks/go-custom-queries.yml +++ b/pr-checks/checks/go-custom-queries.yml @@ -1,11 +1,6 @@ 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: diff --git a/pr-checks/checks/go-indirect-tracing-workaround-diagnostic.yml b/pr-checks/checks/go-indirect-tracing-workaround-diagnostic.yml index c379088e2..599706cc3 100644 --- a/pr-checks/checks/go-indirect-tracing-workaround-diagnostic.yml +++ b/pr-checks/checks/go-indirect-tracing-workaround-diagnostic.yml @@ -6,11 +6,6 @@ operatingSystems: ["ubuntu"] 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: diff --git a/pr-checks/checks/go-indirect-tracing-workaround-no-file-program.yml b/pr-checks/checks/go-indirect-tracing-workaround-no-file-program.yml index 22ad79eb3..ad700ef07 100644 --- a/pr-checks/checks/go-indirect-tracing-workaround-no-file-program.yml +++ b/pr-checks/checks/go-indirect-tracing-workaround-no-file-program.yml @@ -6,11 +6,6 @@ operatingSystems: ["ubuntu"] 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: | diff --git a/pr-checks/checks/go-indirect-tracing-workaround.yml b/pr-checks/checks/go-indirect-tracing-workaround.yml index b5ee15b71..3a564d48e 100644 --- a/pr-checks/checks/go-indirect-tracing-workaround.yml +++ b/pr-checks/checks/go-indirect-tracing-workaround.yml @@ -6,11 +6,6 @@ operatingSystems: ["ubuntu"] 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: diff --git a/pr-checks/checks/go-tracing-autobuilder.yml b/pr-checks/checks/go-tracing-autobuilder.yml index cdb042bfe..9eee38d9e 100644 --- a/pr-checks/checks/go-tracing-autobuilder.yml +++ b/pr-checks/checks/go-tracing-autobuilder.yml @@ -1,11 +1,6 @@ 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" diff --git a/pr-checks/checks/go-tracing-custom-build-steps.yml b/pr-checks/checks/go-tracing-custom-build-steps.yml index 4259fd41a..3c606ae23 100644 --- a/pr-checks/checks/go-tracing-custom-build-steps.yml +++ b/pr-checks/checks/go-tracing-custom-build-steps.yml @@ -1,11 +1,6 @@ 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: diff --git a/pr-checks/checks/go-tracing-legacy-workflow.yml b/pr-checks/checks/go-tracing-legacy-workflow.yml index ea52cb0b1..44b5b274f 100644 --- a/pr-checks/checks/go-tracing-legacy-workflow.yml +++ b/pr-checks/checks/go-tracing-legacy-workflow.yml @@ -1,11 +1,6 @@ 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" diff --git a/pr-checks/sync.py b/pr-checks/sync.py index 7645e2625..74ab744e5 100755 --- a/pr-checks/sync.py +++ b/pr-checks/sync.py @@ -119,16 +119,19 @@ 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\' }}' + baseGoVersionExpr = '>=1.21.0' + workflowInputs['go-version'] = { + 'type': 'string', + 'description': 'The version of Go to install', + 'required': False, + 'default': baseGoVersionExpr, + } steps.append({ 'name': 'Install Go', 'uses': 'actions/setup-go@v5', 'with': { - 'go-version': goVersionExpr, + 'go-version': '${{ inputs.go-version || \'' + baseGoVersionExpr + '\' }}', # to avoid potentially misleading autobuilder results where we expect it to download # dependencies successfully, but they actually come from a warm cache 'cache': False @@ -176,7 +179,8 @@ for file in (this_dir / 'checks').glob('*.yml'): collection_name = checkSpecification['collection'] collections.setdefault(collection_name, []).append({ 'specification': checkSpecification, - 'checkName': checkName + 'checkName': checkName, + 'inputs': workflowInputs }) raw_file = this_dir.parent / ".github" / "workflows" / f"__{checkName}.yml.raw" @@ -222,14 +226,13 @@ for collection_name in collections: for check in collections[collection_name]: checkName = check['checkName'] checkSpecification = check['specification'] - checkInputs = {} + checkInputs = check['inputs'] checkWith = {} - if 'inputs' in checkSpecification: - combinedInputs |= checkSpecification['inputs'] + combinedInputs |= checkInputs - for inputName in checkSpecification['inputs'].keys(): - checkWith[inputName] = "${{ inputs." + inputName + " }}" + for inputName in checkInputs.keys(): + checkWith[inputName] = "${{ inputs." + inputName + " }}" jobs[checkName] = { 'name': checkSpecification['name'],