From 6ad2212b8d6c746b5e26339baa3fbf23190d7bc6 Mon Sep 17 00:00:00 2001 From: Mike Harder Date: Tue, 29 Oct 2024 14:34:44 -0700 Subject: [PATCH] [TypeSpecValidationAll] Add workflow_dispatch, validate typespec-next on trigger (#31319) --- .github/workflows/typespec-validation-all.yaml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/typespec-validation-all.yaml b/.github/workflows/typespec-validation-all.yaml index a66596959380..10047a488c9f 100644 --- a/.github/workflows/typespec-validation-all.yaml +++ b/.github/workflows/typespec-validation-all.yaml @@ -30,6 +30,8 @@ on: # Run 4x/day - cron: '0 0,6,12,18 * * *' + workflow_dispatch: + jobs: typespec-validation-all: name: TypeSpec Validation All @@ -41,6 +43,10 @@ jobs: shard: [0, 1, 2] # total-shards must be an accurate count of the number of shards total-shards: [3] + # When triggered by schedule, validate both the default branch and typespec-next + # Use the placeholder string "default" instead of passing "" directly, since the latter gets ignored by + # the GitHub Jobs UI. + ref: ${{ fromJSON(github.event_name == 'schedule' && '["default", "typespec-next"]' || '["default"]') }} runs-on: ${{ matrix.os }} @@ -51,7 +57,8 @@ jobs: - uses: actions/checkout@v4 with: - fetch-depth: 2 + # Convert placeholder string 'default' to '', which tells the action to checkout the default ref. + ref: ${{ matrix.ref != 'default' && matrix.ref || '' }} - name: Setup Node 20 and run `npm ci` uses: ./.github/actions/setup-node-npm-ci