From bf94daa5510e715a1a9b14d5c790dfd94cb7b3c5 Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Wed, 2 Apr 2025 22:13:42 +0000 Subject: [PATCH 01/26] seed watch-lintdiff.yaml --- .github/workflows/watch-lintdiff.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/watch-lintdiff.yaml diff --git a/.github/workflows/watch-lintdiff.yaml b/.github/workflows/watch-lintdiff.yaml new file mode 100644 index 000000000000..333990deb237 --- /dev/null +++ b/.github/workflows/watch-lintdiff.yaml @@ -0,0 +1,19 @@ +# Use ~ to sort the workflow to the bottom of the list +name: ~Watch - LintDiff + +on: + check_run: + types: [completed] + +jobs: + check-lintdiff: + runs-on: ubuntu-latest + steps: + # Output the JSON of the triggering event using github script + - name: Output check_run event + uses: actions/github-script@v7 + with: + script: | + console.log(JSON.stringify(github.event)); + return JSON.stringify(github.event.check_run); + result-encoding: string From 672c896e9c49d00c0aff9ec4eb6cfa6d9ed8ddd6 Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Wed, 2 Apr 2025 22:18:16 +0000 Subject: [PATCH 02/26] add watch-lintdiff.yaml --- .github/workflows/watch-lintdiff.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/watch-lintdiff.yaml b/.github/workflows/watch-lintdiff.yaml index 333990deb237..0fe693399882 100644 --- a/.github/workflows/watch-lintdiff.yaml +++ b/.github/workflows/watch-lintdiff.yaml @@ -17,3 +17,4 @@ jobs: console.log(JSON.stringify(github.event)); return JSON.stringify(github.event.check_run); result-encoding: string + \ No newline at end of file From f532f21327869071929f585ace5d76746ba5ed44 Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Wed, 2 Apr 2025 15:28:51 -0700 Subject: [PATCH 03/26] checks: read --- .github/workflows/watch-lintdiff.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/watch-lintdiff.yaml b/.github/workflows/watch-lintdiff.yaml index 0fe693399882..9ce00ab1c993 100644 --- a/.github/workflows/watch-lintdiff.yaml +++ b/.github/workflows/watch-lintdiff.yaml @@ -5,6 +5,9 @@ on: check_run: types: [completed] +permissions: + checks: read + jobs: check-lintdiff: runs-on: ubuntu-latest From 60c3e5562521f13c5da8e1a9c5c638372977cf60 Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Wed, 2 Apr 2025 15:33:02 -0700 Subject: [PATCH 04/26] All check_runs --- .github/workflows/watch-lintdiff.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/watch-lintdiff.yaml b/.github/workflows/watch-lintdiff.yaml index 9ce00ab1c993..1e3485a19db3 100644 --- a/.github/workflows/watch-lintdiff.yaml +++ b/.github/workflows/watch-lintdiff.yaml @@ -3,7 +3,6 @@ name: ~Watch - LintDiff on: check_run: - types: [completed] permissions: checks: read From e2e35df1e607cc91afce71f065dbbd016726fe09 Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Wed, 2 Apr 2025 15:44:11 -0700 Subject: [PATCH 05/26] job permissions? --- .github/workflows/watch-lintdiff.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/watch-lintdiff.yaml b/.github/workflows/watch-lintdiff.yaml index 1e3485a19db3..9098f29f00e9 100644 --- a/.github/workflows/watch-lintdiff.yaml +++ b/.github/workflows/watch-lintdiff.yaml @@ -4,11 +4,12 @@ name: ~Watch - LintDiff on: check_run: -permissions: - checks: read + jobs: check-lintdiff: + permissions: + checks: read runs-on: ubuntu-latest steps: # Output the JSON of the triggering event using github script From f85011452d5563677e8596bc3023163ce5aa997e Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Wed, 2 Apr 2025 15:56:04 -0700 Subject: [PATCH 06/26] hello world --- .github/workflows/watch-lintdiff.yaml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/watch-lintdiff.yaml b/.github/workflows/watch-lintdiff.yaml index 9098f29f00e9..122b7b173254 100644 --- a/.github/workflows/watch-lintdiff.yaml +++ b/.github/workflows/watch-lintdiff.yaml @@ -3,8 +3,7 @@ name: ~Watch - LintDiff on: check_run: - - + types: [completed] jobs: check-lintdiff: @@ -17,7 +16,6 @@ jobs: uses: actions/github-script@v7 with: script: | - console.log(JSON.stringify(github.event)); - return JSON.stringify(github.event.check_run); + console.log("hello world"); result-encoding: string \ No newline at end of file From fb24b6706a970a617e237a0c28ac4d5e1e8ea7eb Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Wed, 2 Apr 2025 16:06:13 -0700 Subject: [PATCH 07/26] on: check_run --- .github/workflows/watch-lintdiff.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/watch-lintdiff.yaml b/.github/workflows/watch-lintdiff.yaml index 122b7b173254..5859568a4746 100644 --- a/.github/workflows/watch-lintdiff.yaml +++ b/.github/workflows/watch-lintdiff.yaml @@ -1,9 +1,7 @@ # Use ~ to sort the workflow to the bottom of the list name: ~Watch - LintDiff -on: - check_run: - types: [completed] +on: check_run jobs: check-lintdiff: From 78a893a3795e7954431c66d21907f23196f58cc4 Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Wed, 2 Apr 2025 16:14:42 -0700 Subject: [PATCH 08/26] check_run, check_suite --- .github/workflows/watch-lintdiff.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/watch-lintdiff.yaml b/.github/workflows/watch-lintdiff.yaml index 5859568a4746..cf0daf8a5aeb 100644 --- a/.github/workflows/watch-lintdiff.yaml +++ b/.github/workflows/watch-lintdiff.yaml @@ -1,7 +1,7 @@ # Use ~ to sort the workflow to the bottom of the list name: ~Watch - LintDiff -on: check_run +on: [check_run, check_suite] jobs: check-lintdiff: @@ -9,8 +9,7 @@ jobs: checks: read runs-on: ubuntu-latest steps: - # Output the JSON of the triggering event using github script - - name: Output check_run event + - name: Say hello uses: actions/github-script@v7 with: script: | From 09414a375f2635a1576d587ae5023a9e04de7b0a Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Wed, 2 Apr 2025 16:20:25 -0700 Subject: [PATCH 09/26] write checks --- .github/workflows/watch-lintdiff.yaml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/watch-lintdiff.yaml b/.github/workflows/watch-lintdiff.yaml index cf0daf8a5aeb..4f44f40c8402 100644 --- a/.github/workflows/watch-lintdiff.yaml +++ b/.github/workflows/watch-lintdiff.yaml @@ -1,12 +1,16 @@ # Use ~ to sort the workflow to the bottom of the list name: ~Watch - LintDiff -on: [check_run, check_suite] +on: + check_run: + types: completed + check_suite: + +permissions: + checks: write jobs: check-lintdiff: - permissions: - checks: read runs-on: ubuntu-latest steps: - name: Say hello From 12c4ec6aa5a54a7382e99b0e9ff38865cc5f5428 Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Wed, 2 Apr 2025 16:30:53 -0700 Subject: [PATCH 10/26] check_suite --- .github/workflows/watch-lintdiff.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/watch-lintdiff.yaml b/.github/workflows/watch-lintdiff.yaml index 4f44f40c8402..595e5c549d9f 100644 --- a/.github/workflows/watch-lintdiff.yaml +++ b/.github/workflows/watch-lintdiff.yaml @@ -1,10 +1,9 @@ # Use ~ to sort the workflow to the bottom of the list name: ~Watch - LintDiff -on: - check_run: - types: completed +on: check_suite: + types: completed permissions: checks: write From 57964cdf9f9bddb83f59e3061eed50942329e2fd Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Thu, 3 Apr 2025 06:37:40 -0700 Subject: [PATCH 11/26] workflow_run --- .github/workflows/watch-lintdiff.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/watch-lintdiff.yaml b/.github/workflows/watch-lintdiff.yaml index 595e5c549d9f..8092ed84f13c 100644 --- a/.github/workflows/watch-lintdiff.yaml +++ b/.github/workflows/watch-lintdiff.yaml @@ -2,7 +2,11 @@ name: ~Watch - LintDiff on: - check_suite: + check_run: + types: completed + + workflow_run: + workflows: "[TEST-IGNORE] Swagger LintDiff" types: completed permissions: From 7658bfd9b8061ef0e821fc6e303590ea6f0459ee Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Thu, 3 Apr 2025 06:41:53 -0700 Subject: [PATCH 12/26] workflow_run --- .github/workflows/watch-lintdiff.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/watch-lintdiff.yaml b/.github/workflows/watch-lintdiff.yaml index 8092ed84f13c..4635fbf8dc40 100644 --- a/.github/workflows/watch-lintdiff.yaml +++ b/.github/workflows/watch-lintdiff.yaml @@ -6,8 +6,6 @@ on: types: completed workflow_run: - workflows: "[TEST-IGNORE] Swagger LintDiff" - types: completed permissions: checks: write From c6dc574bae02ac92ac596b51f25e1fc17107332e Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Thu, 3 Apr 2025 06:44:19 -0700 Subject: [PATCH 13/26] workflows --- .github/workflows/watch-lintdiff.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/watch-lintdiff.yaml b/.github/workflows/watch-lintdiff.yaml index 4635fbf8dc40..8a746ee8fdbd 100644 --- a/.github/workflows/watch-lintdiff.yaml +++ b/.github/workflows/watch-lintdiff.yaml @@ -6,6 +6,7 @@ on: types: completed workflow_run: + workflows: ["[TEST-IGNORE] Swagger LintDiff"] permissions: checks: write From 8b768aa9cda561e9a4bc65f838f261d3d595c9e0 Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Thu, 3 Apr 2025 06:49:13 -0700 Subject: [PATCH 14/26] is it a parsing problem? --- .github/workflows/watch-lintdiff.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/watch-lintdiff.yaml b/.github/workflows/watch-lintdiff.yaml index 8a746ee8fdbd..5298cc47f17a 100644 --- a/.github/workflows/watch-lintdiff.yaml +++ b/.github/workflows/watch-lintdiff.yaml @@ -1,12 +1,13 @@ # Use ~ to sort the workflow to the bottom of the list -name: ~Watch - LintDiff +name: "~Watch - LintDiff" on: check_run: types: completed workflow_run: - workflows: ["[TEST-IGNORE] Swagger LintDiff"] + workflows: + - "[TEST-IGNORE] Swagger LintDiff" permissions: checks: write From cd7e696473d936b53bd2c3df93890ec9bd1b5838 Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Thu, 3 Apr 2025 06:50:06 -0700 Subject: [PATCH 15/26] Remove brackets from name --- .github/workflows/lintdiff.yaml | 2 +- .github/workflows/watch-lintdiff.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lintdiff.yaml b/.github/workflows/lintdiff.yaml index 576a33c2496b..e8beb69a08bb 100644 --- a/.github/workflows/lintdiff.yaml +++ b/.github/workflows/lintdiff.yaml @@ -1,4 +1,4 @@ -name: "[TEST-IGNORE] Swagger LintDiff" +name: "Swagger LintDiff" on: pull_request diff --git a/.github/workflows/watch-lintdiff.yaml b/.github/workflows/watch-lintdiff.yaml index 5298cc47f17a..76c5f1e8b031 100644 --- a/.github/workflows/watch-lintdiff.yaml +++ b/.github/workflows/watch-lintdiff.yaml @@ -7,7 +7,7 @@ on: workflow_run: workflows: - - "[TEST-IGNORE] Swagger LintDiff" + - "Swagger LintDiff" permissions: checks: write From e15d77f0c07a1cfff44c46e9712d484988dd3fdb Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Thu, 3 Apr 2025 06:53:13 -0700 Subject: [PATCH 16/26] Add brackets back in --- .github/workflows/lintdiff.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lintdiff.yaml b/.github/workflows/lintdiff.yaml index e8beb69a08bb..576a33c2496b 100644 --- a/.github/workflows/lintdiff.yaml +++ b/.github/workflows/lintdiff.yaml @@ -1,4 +1,4 @@ -name: "Swagger LintDiff" +name: "[TEST-IGNORE] Swagger LintDiff" on: pull_request From 1780c1698389a1b8af3792c96edcaacac59b652c Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Thu, 3 Apr 2025 06:54:08 -0700 Subject: [PATCH 17/26] Escape attempt --- .github/workflows/watch-lintdiff.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/watch-lintdiff.yaml b/.github/workflows/watch-lintdiff.yaml index 76c5f1e8b031..7e70bc10dcec 100644 --- a/.github/workflows/watch-lintdiff.yaml +++ b/.github/workflows/watch-lintdiff.yaml @@ -7,7 +7,7 @@ on: workflow_run: workflows: - - "Swagger LintDiff" + - "\[TEST-IGNORE\] Swagger LintDiff" permissions: checks: write From 2b812cf3f9a8cf3ed3fefbadf253564694c0a3c2 Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Thu, 3 Apr 2025 06:56:07 -0700 Subject: [PATCH 18/26] double slashes --- .github/workflows/watch-lintdiff.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/watch-lintdiff.yaml b/.github/workflows/watch-lintdiff.yaml index 7e70bc10dcec..d036dfd26fe7 100644 --- a/.github/workflows/watch-lintdiff.yaml +++ b/.github/workflows/watch-lintdiff.yaml @@ -7,7 +7,7 @@ on: workflow_run: workflows: - - "\[TEST-IGNORE\] Swagger LintDiff" + - "\\[TEST-IGNORE\\] Swagger LintDiff" permissions: checks: write From db492bef82f2a71371778bf827fc3f13c27c71d8 Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Thu, 3 Apr 2025 06:58:10 -0700 Subject: [PATCH 19/26] types: completed --- .github/workflows/watch-lintdiff.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/watch-lintdiff.yaml b/.github/workflows/watch-lintdiff.yaml index d036dfd26fe7..18e900cf2cdc 100644 --- a/.github/workflows/watch-lintdiff.yaml +++ b/.github/workflows/watch-lintdiff.yaml @@ -6,6 +6,7 @@ on: types: completed workflow_run: + types: completed workflows: - "\\[TEST-IGNORE\\] Swagger LintDiff" From 036762c5a39ee23d602a4a7c4081a8cee7de6902 Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Thu, 3 Apr 2025 06:59:44 -0700 Subject: [PATCH 20/26] log workflow_run object --- .github/workflows/watch-lintdiff.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/watch-lintdiff.yaml b/.github/workflows/watch-lintdiff.yaml index 18e900cf2cdc..567e363b7850 100644 --- a/.github/workflows/watch-lintdiff.yaml +++ b/.github/workflows/watch-lintdiff.yaml @@ -21,6 +21,6 @@ jobs: uses: actions/github-script@v7 with: script: | - console.log("hello world"); + console.log(github.event.workflow_run); result-encoding: string \ No newline at end of file From f9aa86d129d6a574ee2dd0621cecaa98ee729a4e Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Thu, 3 Apr 2025 07:00:00 -0700 Subject: [PATCH 21/26] remove completed, more runs --- .github/workflows/watch-lintdiff.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/watch-lintdiff.yaml b/.github/workflows/watch-lintdiff.yaml index 567e363b7850..f0c7bd178b62 100644 --- a/.github/workflows/watch-lintdiff.yaml +++ b/.github/workflows/watch-lintdiff.yaml @@ -6,7 +6,6 @@ on: types: completed workflow_run: - types: completed workflows: - "\\[TEST-IGNORE\\] Swagger LintDiff" From baf194927e1f6441bbe613ddf2fe8e74cd2f305d Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Thu, 3 Apr 2025 07:01:23 -0700 Subject: [PATCH 22/26] context.payload --- .github/workflows/watch-lintdiff.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/watch-lintdiff.yaml b/.github/workflows/watch-lintdiff.yaml index f0c7bd178b62..dd06fbe9d92e 100644 --- a/.github/workflows/watch-lintdiff.yaml +++ b/.github/workflows/watch-lintdiff.yaml @@ -14,12 +14,12 @@ permissions: jobs: check-lintdiff: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: Say hello uses: actions/github-script@v7 with: script: | - console.log(github.event.workflow_run); + console.log(context.payload); result-encoding: string \ No newline at end of file From 0edb76ba1878f9bfcb85b70395e4175e04bf7257 Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Thu, 3 Apr 2025 07:20:48 -0700 Subject: [PATCH 23/26] More logging --- .github/workflows/watch-lintdiff.yaml | 36 ++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/.github/workflows/watch-lintdiff.yaml b/.github/workflows/watch-lintdiff.yaml index dd06fbe9d92e..d26f14ba69be 100644 --- a/.github/workflows/watch-lintdiff.yaml +++ b/.github/workflows/watch-lintdiff.yaml @@ -16,10 +16,40 @@ jobs: check-lintdiff: runs-on: ubuntu-24.04 steps: - - name: Say hello + # *** IMPORTANT *** + # For workflows that are triggered by the pull_request_target event, the workflow runs in the + # context of the base of the pull request. You should make sure that you do not check out, + # build, or run untrusted code from the head of the pull request. + - uses: actions/checkout@v4 + with: + # Only needs .github folder for automation, not the files in the PR (analyzed in a + # separate workflow). + # + # Uses the .github folder from the PR base branch (pull_request_target trigger), + # or the repo default branch (other triggers). + sparse-checkout: | + .github + + - name: Verify Workflow Status + if: github.event_name == 'workflow_run' uses: actions/github-script@v7 with: script: | - console.log(context.payload); - result-encoding: string + console.log("Checking workflow status"); + console.log(JSON.stringify(context.payload)); + console.log(`State: ${context.payload.workflow.state}`); + + // TODO: Get status of the check run status and compare + + - name: Verify Check Run Status + if: github.event_name == 'check_run' + uses: actions/github-script@v7 + with: + script: | + console.log("Checking check status") + console.log(JSON.stringify(context.payload)); + console.log(`State: ${context.payload.check_run.conclusion}`); + + // TODO: Get the status of the workflow run and compare + \ No newline at end of file From 3c1d1e67e8189b53bd30b091372c51d8266bc33c Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Thu, 3 Apr 2025 07:24:26 -0700 Subject: [PATCH 24/26] Formatting --- .github/workflows/watch-lintdiff.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/watch-lintdiff.yaml b/.github/workflows/watch-lintdiff.yaml index d26f14ba69be..129f35b906fb 100644 --- a/.github/workflows/watch-lintdiff.yaml +++ b/.github/workflows/watch-lintdiff.yaml @@ -6,6 +6,7 @@ on: types: completed workflow_run: + types: completed workflows: - "\\[TEST-IGNORE\\] Swagger LintDiff" @@ -36,7 +37,7 @@ jobs: with: script: | console.log("Checking workflow status"); - console.log(JSON.stringify(context.payload)); + console.log(JSON.stringify(context.payload, null, 2)); console.log(`State: ${context.payload.workflow.state}`); // TODO: Get status of the check run status and compare @@ -47,7 +48,7 @@ jobs: with: script: | console.log("Checking check status") - console.log(JSON.stringify(context.payload)); + console.log(JSON.stringify(context.payload, null, 2)); console.log(`State: ${context.payload.check_run.conclusion}`); // TODO: Get the status of the workflow run and compare From 34e4f57367e92e322e3edd17209124804fba9c99 Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Thu, 3 Apr 2025 10:42:40 -0700 Subject: [PATCH 25/26] basic api calls to get more outputs --- .github/workflows/watch-lintdiff.yaml | 33 +++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/.github/workflows/watch-lintdiff.yaml b/.github/workflows/watch-lintdiff.yaml index 129f35b906fb..ebe774ee92d4 100644 --- a/.github/workflows/watch-lintdiff.yaml +++ b/.github/workflows/watch-lintdiff.yaml @@ -16,6 +16,8 @@ permissions: jobs: check-lintdiff: runs-on: ubuntu-24.04 + # TODO: Only run if check_run or workflow_run is initiated by pull_request + steps: # *** IMPORTANT *** # For workflows that are triggered by the pull_request_target event, the workflow runs in the @@ -37,10 +39,21 @@ jobs: with: script: | console.log("Checking workflow status"); - console.log(JSON.stringify(context.payload, null, 2)); - console.log(`State: ${context.payload.workflow.state}`); + console.log(JSON.stringify(context.payload)); + console.log(`State: ${context.payload.workflow_run.conclusion}`); + + // Get status of check run named "Swagger LintDiff" + const checkRunName = "Swagger LintDiff"; + // TODO: Paginate + const checkRuns = await github.checks.listForRef({ + ...context.repo, + ref: context.payload.workflow_run.head_sha, + check_name: checkRunName, + status: "completed", + }); - // TODO: Get status of the check run status and compare + console.log("Check runs:"); + console.log(JSON.stringify(checkRuns.data.check_runs, null, 2)); - name: Verify Check Run Status if: github.event_name == 'check_run' @@ -48,9 +61,19 @@ jobs: with: script: | console.log("Checking check status") - console.log(JSON.stringify(context.payload, null, 2)); + console.log(JSON.stringify(context.payload)); console.log(`State: ${context.payload.check_run.conclusion}`); - // TODO: Get the status of the workflow run and compare + // Get status of the workflow run named "[TEST-IGNORE] Swagger LintDiff" + const workflowRunName = "[TEST-IGNORE] Swagger LintDiff"; + // TODO: Paginate + const workflowRuns = await github.actions.listWorkflowRunsForRepo({ + ...context.repo, + head_sha: context.payload.check_run.head_sha, + status: "completed", + }); + + console.log("Workflow runs:"); + console.log(JSON.stringify(workflowRuns.data.workflow_runs, null, 2)); \ No newline at end of file From 75ec3d23d8565685eda6c759247aec60a0eca7c3 Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Thu, 3 Apr 2025 10:45:41 -0700 Subject: [PATCH 26/26] .rest --- .github/workflows/watch-lintdiff.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/watch-lintdiff.yaml b/.github/workflows/watch-lintdiff.yaml index ebe774ee92d4..7996a9be5a14 100644 --- a/.github/workflows/watch-lintdiff.yaml +++ b/.github/workflows/watch-lintdiff.yaml @@ -45,7 +45,7 @@ jobs: // Get status of check run named "Swagger LintDiff" const checkRunName = "Swagger LintDiff"; // TODO: Paginate - const checkRuns = await github.checks.listForRef({ + const checkRuns = await github.rest.checks.listForRef({ ...context.repo, ref: context.payload.workflow_run.head_sha, check_name: checkRunName, @@ -67,7 +67,7 @@ jobs: // Get status of the workflow run named "[TEST-IGNORE] Swagger LintDiff" const workflowRunName = "[TEST-IGNORE] Swagger LintDiff"; // TODO: Paginate - const workflowRuns = await github.actions.listWorkflowRunsForRepo({ + const workflowRuns = await github.rest.actions.listWorkflowRunsForRepo({ ...context.repo, head_sha: context.payload.check_run.head_sha, status: "completed",