display_title is not showing up
prathamesh-dev9 opened this issue · comments
I'm creating a simple plugin which will fetch all GitHub workflow runs and displaying them with their name with status.
But unfortunately, it is giving me error. If i'm accessing name or any other value of workflow ${workflow['name']
then plugin is working fine.
Xbar - v2.7.1-beta
Please look into this issue
![image](https://private-user-images.githubusercontent.com/38277567/238727178-f365b767-fa55-4324-af92-44438f70f02a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTU5MDQxNzcsIm5iZiI6MTcxNTkwMzg3NywicGF0aCI6Ii8zODI3NzU2Ny8yMzg3MjcxNzgtZjM2NWI3NjctZmE1NS00MzI0LWFmOTItNDQ0MzhmNzBmMDJhLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA1MTYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNTE2VDIzNTc1N1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWU4N2QwNTUxMDIwYTk1ZjJlZDRiNjlmNjMwNjBjYWIwZDk1ODRhNjZlMmZhMzJmOTI1MWExYzMwZTg1M2FmZmMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.590GCKyFkxe8ZWYl9tix2zSNIoFVpWFUsiS56Xx5IIw)
My code is as below
#!/usr/bin/env /path_to_node_executable
const axios = require("axios");
const accessToken = "github_access_token";
const apiUrl = "https://api.github.com/repos/user_name/repo_name/actions/runs";
axios
.get(apiUrl, {
headers: {
Authorization: `Bearer ${accessToken}`,
Accept: "application/vnd.github.v3+json",
},
})
.then((response) => {
const data = response.data;
// Filter and display the running workflows
const runningWorkflows = data.workflow_runs.filter(
(run) => run.status === "in_progress"
);
console.log(`Running Workflows (${runningWorkflows.length}):`);
console.log("---");
// Filter and display the completed workflows
const completedWorkflows = data.workflow_runs.filter(
(run) => run.status !== "in_progress"
);
console.log("---");
console.log(`Completed Workflows (${completedWorkflows.length}):`);
console.log("---");
completedWorkflows.forEach((workflow) => {
console.log(`${workflow["display_title"]} -> ${workflow["status"]}`);
});
})
.catch((error) => {
console.log(`Failed to fetch workflow runs. Error: ${error}`);
});