diff --git a/.github/workflows/pr-automation.yml b/.github/workflows/pr-automation.yml
index 4f4f7985d6..f228ba5429 100644
--- a/.github/workflows/pr-automation.yml
+++ b/.github/workflows/pr-automation.yml
@@ -36,7 +36,7 @@ jobs:
NODE_PATH: "${{ github.workspace }}/.github/workflows/scripts"
with:
script: |
- require("test-tag-parser.js")({core, context})
+ require("test-tag-parser.js")({core, context, github})
# In case of a run with all test cases, allocate a larger matrix
- name: Check if @tag.All is present in tags
diff --git a/.github/workflows/pr-cypress.yml b/.github/workflows/pr-cypress.yml
index 8234f89507..6c49b3f14b 100644
--- a/.github/workflows/pr-cypress.yml
+++ b/.github/workflows/pr-cypress.yml
@@ -173,7 +173,7 @@ jobs:
if: needs.ci-test.result != 'success'
shell: bash
run: |
- new_failed_spec_env="$(comm -1 -3 <(sort ~/knownfailures) <(sort -u ~/combined_failed_spec_ci) | sed 's/|cypress|cypress/\n/g' | sed 's/^/>
/')"
+ new_failed_spec_env="$(comm -1 -3 <(sort ~/knownfailures) <(sort -u ~/combined_failed_spec_ci) | sed 's/|cypress|cypress/\n/g' | sed 's/^//')"
echo "$new_failed_spec_env"
echo "new_failed_spec_env<> $GITHUB_ENV
echo "$new_failed_spec_env" >> $GITHUB_ENV
@@ -181,63 +181,54 @@ jobs:
- name: Modify test response in the PR with new CI failures
if: needs.ci-test.result != 'success' && steps.combine_ci.outputs.specs_failed == '1'
- uses: nefrob/pr-description@v1.1.2
+ uses: actions/github-script@v7
+ env:
+ NODE_PATH: "${{ github.workspace }}/.github/workflows/scripts"
+ BODY: |
+ Some tests have failed.
+ Workflow run: <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}>
+ Commit: ${{ github.event.pull_request.head.sha }}
+ Cypress dashboard.
+ Tags: ${{ inputs.tags }}
+ The following are new failures, please fix them before merging the PR:
+ ${{env.new_failed_spec_env}}
+ List of identified flaky tests.
with:
- content: |
-
- > [!CAUTION]
- > 🔴 🔴 🔴 Some tests have failed.
- > Workflow run: <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}>
- > Commit: ${{ github.event.pull_request.head.sha }}
- > Cypress dashboard.
- > Tags: `${{ inputs.tags }}`
- > The following are new failures, please fix them before merging the PR:
- ${{env.new_failed_spec_env}}
- > List of identified flaky tests.
-
-
-
- regex: ".*?"
- regexFlags: ims
- token: ${{ secrets.GITHUB_TOKEN }}
+ script: |
+ require("write-cypress-status.js")({core, context, github}, "caution", process.env.BODY)
+ core.setFailed()
- name: Modify test response in the PR when ci-test is failed but no specs found
if: needs.ci-test.result != 'success' && steps.combine_ci.outputs.specs_failed == '0'
- uses: nefrob/pr-description@v1.1.2
+ uses: actions/github-script@v7
+ env:
+ NODE_PATH: "${{ github.workspace }}/.github/workflows/scripts"
+ BODY: |
+ Workflow run: <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}>
+ Commit: ${{ github.event.pull_request.head.sha }}
+ Cypress dashboard.
+ Tags: ${{ inputs.tags }}
+ It seems like **no tests ran** 😔. We are not able to recognize it, please check workflow here.
with:
- content: |
-
- > [!WARNING]
- > Workflow run: <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}>
- > Commit: ${{ github.event.pull_request.head.sha }}
- > Cypress dashboard.
- > Tags: `${{ inputs.tags }}`
- > It seems like **no tests ran** 😔. We are not able to recognize it, please check workflow here.
-
-
-
- regex: ".*?"
- regexFlags: ims
- token: ${{ secrets.GITHUB_TOKEN }}
+ script: |
+ require("write-cypress-status.js")({core, context, github}, "warning", process.env.BODY)
+ core.setFailed()
- name: Modify test response in the PR when ci-test is success
if: needs.ci-test.result == 'success' && steps.combine_ci.outputs.specs_failed == '0'
- uses: nefrob/pr-description@v1.1.2
+ uses: actions/github-script@v7
+ env:
+ NODE_PATH: "${{ github.workspace }}/.github/workflows/scripts"
+ BODY: |
+ All cypress tests have passed! 🎉 🎉 🎉
+ Workflow run: <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}>
+ Commit: ${{ github.event.pull_request.head.sha }}
+ Cypress dashboard.
+ Tags: `${{ inputs.tags }}`
with:
- content: |
-
- > [!TIP]
- > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
- > Workflow run: <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}>
- > Commit: ${{ github.event.pull_request.head.sha }}
- > Cypress dashboard.
- > Tags: `${{ inputs.tags }}`
-
-
-
- regex: ".*?"
- regexFlags: ims
- token: ${{ secrets.GITHUB_TOKEN }}
+ script: |
+ require("write-cypress-status.js")({core, context, github}, "tip", process.env.BODY)
+ core.setFailed()
- name: Check ci-test set status
if: needs.ci-test.result != 'success'
diff --git a/.github/workflows/scripts/test-tag-parser.js b/.github/workflows/scripts/test-tag-parser.js
index 20a5dd2e4f..2309de878b 100644
--- a/.github/workflows/scripts/test-tag-parser.js
+++ b/.github/workflows/scripts/test-tag-parser.js
@@ -1,9 +1,9 @@
-module.exports = function ({core, context}) {
+module.exports = function ({core, context, github}) {
let tags;
try {
tags = parseTags(context.payload.pull_request.body);
} catch (error) {
- core.setFailure(error.message);
+ core.setFailed(error.message);
core.setOutput("outcome", "failure");
const body = [
"Invalid tags. Please use `/ok-to-test tags=\"@tag.All\"` or `/test all` in the PR body to run all tests.",
diff --git a/.github/workflows/scripts/write-cypress-status.js b/.github/workflows/scripts/write-cypress-status.js
index b40fc377cb..28cbc50ff4 100644
--- a/.github/workflows/scripts/write-cypress-status.js
+++ b/.github/workflows/scripts/write-cypress-status.js
@@ -6,7 +6,9 @@ const PATTERN = new RegExp(HEADER + ".*?" + FOOTER, "ims");
const VALID_ALERT_TYPES = ["note", "tip", "important", "warning", "caution"]
const ALERT_PREFIXES = {
+ tip: "🟢 🟢 🟢 ",
important: "🟣 🟣 🟣 ",
+ caution: "🔴 🔴 🔴 ",
}
module.exports = async function({core, context, github}, alertType, note) {