From 47042464176d8f7e1a13f1c7f151280f709b7eda Mon Sep 17 00:00:00 2001 From: Cameron Dunn Date: Wed, 27 Dec 2023 14:44:29 -0800 Subject: [PATCH] Use fork to ignore certain IDs --- .github/workflows/rule-validate.yml | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rule-validate.yml b/.github/workflows/rule-validate.yml index 5e6ba64af2a..e8f10306af2 100644 --- a/.github/workflows/rule-validate.yml +++ b/.github/workflows/rule-validate.yml @@ -295,6 +295,24 @@ jobs: // MQL Mimic will handle duplicates gracefully, no need to handle here. return allEMLsToSkip.join(" ") + - name: "Find Existing MQL Mimic Test Results" + uses: actions/github-script@v6 + id: find_mql_mimic_results + with: + debug: ${{ secrets.ACTIONS_STEP_DEBUG || false }} + env: + sha: '${{ steps.get_head.outputs.HEAD }}' + script: | + const result = await client.rest.checks.listForRef({ + check_name: "MQL Mimic Tests", + owner: "sublime-security", + repo: "sublime-rules" + ref: process.env.sha + }) + + let existingRuns = result.data.check_runs.map((r) => r.id) + console.log(existingRuns) + return existingRuns - name: "Trigger MQL Mimic Tests" env: @@ -314,12 +332,12 @@ jobs: -d "$body" - name: Wait for MQL Mimic check to be completed - uses: fountainhead/action-wait-for-check@v1.1.0 - id: wait-for-build + uses: sublime-security/action-wait-for-check@v1.1.0 # Wait for results so that the token remains valid while the test suite is executing and posting a check here. with: token: ${{ secrets.GITHUB_TOKEN }} checkName: "MQL Mimic Tests" ref: ${{ steps.get_head.outputs.HEAD }} timeoutSeconds: 3600 + ignoreIDs: ${{ steps.find_mql_mimic_results.outputs.result }}