From 30e4abc84d08642ee47d01c9cfad2ea3f4d152c0 Mon Sep 17 00:00:00 2001
From: Parth Patel
Date: Sat, 25 May 2024 13:26:00 +1200
Subject: [PATCH] Update pr-validation.yml
---
.github/workflows/pr-validation.yml | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/pr-validation.yml b/.github/workflows/pr-validation.yml
index 52bd9e2..3096109 100644
--- a/.github/workflows/pr-validation.yml
+++ b/.github/workflows/pr-validation.yml
@@ -36,13 +36,24 @@ jobs:
const description = ${{ steps.validation.outputs.PR_STATUS }} ? "PR title is valid." : `PR title is invalid. Ensure it matches the pattern: ${regex}`;
const prNumber = context.payload.pull_request.number;
const commitSha = context.payload.pull_request.head.sha;
+ const runId = context.runId;
+ const repoOwner = context.repo.owner;
+ const repoName = context.repo.repo;
+
const contextName = process.env.GITHUB_WORKFLOW;
+
+ const workflowRun = await github.actions.getWorkflowRun({
+ owner: repoOwner,
+ repo: repoName,
+ run_id: runId
+ });
+ console.log(workflowRun.data);
// Create a status check
await github.rest.repos.createCommitStatus({
- owner: context.repo.owner,
- repo: context.repo.repo,
+ owner: repoOwner,
+ repo: repoName,
sha: commitSha,
state: state,
context: contextName,