From 3e30af1c2974ae8bd239e50741e59a0ebddfefbb Mon Sep 17 00:00:00 2001 From: ItsDrike Date: Thu, 23 May 2024 15:20:44 +0200 Subject: [PATCH] Fix the status embed workflow --- .github/workflows/main.yml | 22 ++++++++++++++++++++++ .github/workflows/status_embed.yml | 2 +- changes/300.internal.md | 1 + 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1ff942a0..9f160c3b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,3 +19,25 @@ jobs: unit-tests: uses: ./.github/workflows/unit-tests.yml + + # Produce a pull request payload artifact with various data about the + # pull-request event (such as the PR number, title, author, ...). + # This data is then be picked up by status-embed.yml action. + pr_artifact: + name: Produce Pull Request payload artifact + runs-on: ubuntu-latest + + steps: + - name: Prepare Pull Request Payload artifact + id: prepare-artifact + if: always() && github.event_name == 'pull_request' + continue-on-error: true + run: cat $GITHUB_EVENT_PATH | jq '.pull_request' > pull_request_payload.json + + - name: Upload a Build Artifact + if: always() && steps.prepare-artifact.outcome == 'success' + continue-on-error: true + uses: actions/upload-artifact@v4 + with: + name: pull-request-payload + path: pull_request_payload.json diff --git a/.github/workflows/status_embed.yml b/.github/workflows/status_embed.yml index b6882bf6..fea615e2 100644 --- a/.github/workflows/status_embed.yml +++ b/.github/workflows/status_embed.yml @@ -20,7 +20,7 @@ jobs: steps: # A workflow_run event does not contain all the information # we need for a PR embed. That's why we upload an artifact - # with that information in the Lint workflow. + # with that information in the CI workflow. - name: Get Pull Request Information id: pr_info if: github.event.workflow_run.event == 'pull_request' diff --git a/changes/300.internal.md b/changes/300.internal.md index eb170396..cb1372e3 100644 --- a/changes/300.internal.md +++ b/changes/300.internal.md @@ -3,3 +3,4 @@ - Trigger and run lint and unit-tests workflows form a single main CI workflow. - Only send status embed after the main CI workflow finishes (not for both unit-tests and validation) - Use `--output-format=github` for `ruff check` in the validation workflow +- Fix the status-embed workflow