Skip to content

Commit

Permalink
Added octokit parser
Browse files Browse the repository at this point in the history
  • Loading branch information
nbhoski committed Jun 12, 2024
1 parent c006d6e commit 5ca0feb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/buildSummary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,13 @@ export function getWorkflowStepNames() {
const repository = process.env.GITHUB_REPOSITORY;
const [owner, repo] = repository.split('/');
const runId = process.env.GITHUB_RUN_ID
getWorkflowRunJobs(owner as string, repo as string, runId as string)
getWorkflowRunJobs(owner as string, repo as string, runId as string);
}



// Function to get workflow run jobs and step names
export async function getWorkflowRunJobs(owner, repo, runId) {
export async function getWorkflowRunJobs(owner as string, repo as string, runId as string) {
// Replace with your GitHub personal access token
const octokit = new Octokit({
auth: process.env.GITHUB_TOKEN,
Expand All @@ -105,9 +105,9 @@ export async function getWorkflowRunJobs(owner, repo, runId) {

// Iterate over the jobs and log the step names
const jobs = response.data.jobs;
jobs.forEach((job) => {
jobs.forEach((job as string) => {
console.log(`Job: ${job.name}`);
job.steps.forEach((step) => {
job.steps.forEach((step as string) => {
console.log(` **Step: ${step.name}`);
console.log(` **Uses: ${step.uses}`);
});
Expand Down

0 comments on commit 5ca0feb

Please sign in to comment.