From 03be36ff4586f3bd5218043942c6ce9cf36e0ceb Mon Sep 17 00:00:00 2001 From: Dmitry Gurevich <99176494+gurevichdmitry@users.noreply.github.com> Date: Tue, 9 Apr 2024 17:29:27 +0300 Subject: [PATCH] Revert "[8.13](backport #2089) Update rerun workflow (#2107)" This reverts commit 3611691073d6cca1deed907c5165efd904f8b0e4. --- .github/workflows/rerun-flaky-workflows.yml | 47 ++++++--------------- 1 file changed, 13 insertions(+), 34 deletions(-) diff --git a/.github/workflows/rerun-flaky-workflows.yml b/.github/workflows/rerun-flaky-workflows.yml index a4ed8ce145..d9b876bd63 100644 --- a/.github/workflows/rerun-flaky-workflows.yml +++ b/.github/workflows/rerun-flaky-workflows.yml @@ -15,34 +15,22 @@ jobs: actions: write steps: - name: Display Workflow Run Information - env: - WORKFLOW_RUN_ID: ${{ github.event.workflow_run.id }} - WORKFLOW_RUN_NAME: ${{ github.event.workflow_run.name }} - WORKFLOW_RUN_ATTEMPT: ${{ github.event.workflow_run.run_attempt }} - WORKFLOW_RUN_HTML_URL: ${{ github.event.workflow_run.html_url }} - GITHUB_JOB: ${{ github.job }} - GITHUB_RUN_ATTEMPT: ${{ github.run_attempt }} - AUTHOR_NAME: ${{ github.event.workflow_run.head_commit.author.name }} - GITHUB_ACTOR: ${{ github.actor }} run: | - echo "The Workflow Run ${{ env.WORKFLOW_RUN_NAME }} has failed! " >> $GITHUB_STEP_SUMMARY - echo "View the failed run attempt (#${{ env.WORKFLOW_RUN_ATTEMPT }}) here: ${{ env.WORKFLOW_RUN_HTML_URL }}" >> $GITHUB_STEP_SUMMARY - echo "Workflow Run ID: ${{ env.WORKFLOW_RUN_ID }}" - echo "Job ID: ${{ env.GITHUB_JOB }}" - echo "Current run: ${{ env.GITHUB_RUN_ATTEMPT }}" - echo "Author: ${{ env.AUTHOR_NAME }}" - echo "Actor: ${{ env.GITHUB_ACTOR }}" + echo "The Workflow Run ${{ github.event.workflow_run.name }} has failed! " >> $GITHUB_STEP_SUMMARY + echo "View the failed run attempt (#${{ github.event.workflow_run.run_attempt }}) here: ${{ github.event.workflow_run.html_url }}" >> $GITHUB_STEP_SUMMARY + echo "Workflow Run ID: ${{ github.event.workflow_run.id }}" + echo "Job ID: ${{ github.job }}" + echo "Current run: ${{ github.run_attempt }}" + echo "Author: ${{ github.event.workflow_run.head_commit.author.name }}" + echo "Actor: ${{ github.actor }}" - name: Rerun failed jobs in the current workflow env: GH_TOKEN: ${{ github.token }} - WORKFLOW_RUN_ATTEMPT: ${{ github.event.workflow_run.run_attempt }} - WORKFLOW_RUN_ID: ${{ github.event.workflow_run.id }} - GITHUB_REPOSITORY: ${{ github.repository }} run: | MAX_RUNS=2 - CURRENT_RUN=${{ env.WORKFLOW_RUN_ATTEMPT }} + CURRENT_RUN=${{ github.event.workflow_run.run_attempt }} if [ $CURRENT_RUN -lt $MAX_RUNS ]; then - gh run rerun ${{ env.WORKFLOW_RUN_ID }} --repo ${{ env.GITHUB_REPOSITORY }} --failed + gh run rerun ${{ github.event.workflow_run.id }} --repo ${{ github.repository }} --failed else exit 1 fi @@ -52,19 +40,13 @@ jobs: - name: Update env vars if: ${{ !cancelled() && failure() }} # Run only if the previous step failed - env: - WORKFLOW_RUN_HEAD_SHA: ${{ github.event.workflow_run.head_sha }} run: | - commit_short=$(git rev-parse --short ${{ env.WORKFLOW_RUN_HEAD_SHA }}) + commit_short=$(git rev-parse --short ${{ github.event.workflow_run.head_sha }}) echo "BREAKING_COMMIT_SHORT=$commit_short" >> $GITHUB_ENV - name: Slack Notification uses: ./.github/actions/slack-notification -<<<<<<< HEAD if: ${{ !cancelled() && failure() }} # Run only if the previous step failed -======= - if: ${{ !cancelled() && failure() && github.event.workflow_run.head_branch == 'main'}} # Run only if the previous step failed ->>>>>>> 61b21ecb (Update rerun workflow (#2089)) continue-on-error: true env: BREAKING_COMMIT: "${{ github.event.workflow_run.head_sha }}" @@ -72,22 +54,19 @@ jobs: RUN_NAME: "${{ github.event.workflow_run.name }}" BRANCH: "${{ github.event.workflow_run.head_branch }}" REPO: "${{ github.repository }}" - WORKFLOW_NAME: "${{ github.event.workflow.name }}" - WORKFLOW_HEAD_BRANCH: "${{ github.event.workflow_run.head_branch }}" - GITHUB_ACTOR: "${{ github.actor }}" with: vault-url: ${{ secrets.VAULT_ADDR }} vault-role-id: ${{ secrets.CSP_VAULT_ROLE_ID }} vault-secret-id: ${{ secrets.CSP_VAULT_SECRET_ID }} slack-payload: | { - "text": ":alert: CI ${{ env.WORKFLOW_NAME }} is failing on ${{ env.WORKFLOW_HEAD_BRANCH }} :alert:", + "text": ":alert: CI ${{ github.event.workflow.name }} is failing on ${{ github.event.workflow_run.head_branch }} :alert:", "blocks": [ { "type": "header", "text": { "type": "plain_text", - "text": ":alert: CI ${{ env.WORKFLOW_NAME }} is failing on ${{ env.WORKFLOW_HEAD_BRANCH }} :alert:", + "text": ":alert: CI ${{ github.event.workflow.name }} is failing on ${{ github.event.workflow_run.head_branch }} :alert:", "emoji": true } } @@ -100,7 +79,7 @@ jobs: "type": "section", "text": { "type": "mrkdwn", - "text": "Commit by ${{env.GITHUB_ACTOR}} has failing tests on the `${{env.BRANCH}}` branch." + "text": "Commit by ${{github.actor}} has failing tests on the `${{env.BRANCH}}` branch." } }, {