octokit / octokit.js

The all-batteries-included GitHub SDK for Browsers, Node.js, and Deno.
MIT License
6.83k stars 1k forks source link

[BUG]: Unable to get latest deployment for a workflow deployed to an environment #2649

Open mssanjay opened 3 months ago

mssanjay commented 3 months ago

What happened?

``Hi, I am trying to build a report for all of my deployments for our product which has about 15+ repos. I like to create a Github Page with all the repos listed with their workflows and deployments for the 4 environments I have. I was able to get latest deployment but it could be any of the workflow. So, my problem is that I am unable to get latest deployment for an environment for a specific workflow. How can I get this info?

Here is what I am using currently

  1. For repo details,
    octokit.repos.get({
    owner: REPO_OWNER,
    repo,
    });
  2. For list of workflows
    octokit.actions.listRepoWorkflows({
      owner: REPO_OWNER,
      repo: repo,
    });

But for deployments, below API does not offer workflow as input. So, how can I go about getting the data for a specific workflow deployment action?

octokit.repos.listDeployments({
    owner: REPO_OWNER,
    repo: repositoryDetails.name,
    environment: environment,
    per_page: 1,
    page: 1,
  });

Thanks Sanjay

Versions

"@octokit/rest": "20.0.2"

Relevant log output

No response

Code of Conduct

github-actions[bot] commented 3 months ago

👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labled with Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! 🚀