Associating GitHub Actions Workflow Jobs to their API Counterpart #38277
Replies: 2 comments 2 replies
-
I don't think this is enough, we need the jobid of the rest api, which is not sent to the runner via the protocol.
|
Beta Was this translation helpful? Give feedback.
-
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
-
Hello!
My team and I have been working on an integration with GitHub for a while now and have been running into some challenges around the cohesion between the actions runner environment and the GitHub Rest API.
Long story short, we were finding that in some cases it's a little challenging to associate a job that's running in Actions to a job that's returned by the API:
GITHUB_JOB
environment variable (which is the YAML key) (no database identifier or anything of that nature)I've opened a PR to the runner to expose the display name, which would significantly help, but we were wondering if it'd be possible to expose the YAML key through the GitHub API (the same thing exposed in the
GITHUB_JOB
environment variable) as well. The combination of YAML key + display name, I believe, would let us uniquely identify a job within the list that's returned from, e.g., the list jobs endpoint. Right now, that's not possible with the runner PR alone because, while likely a rare occurrence, job display names do not need to be unique.I will note, however, that really my suggestions here are a sort of stop-gap. As I alluded to in the runner PR, it'd be great if the job's database identifier could be included in the runner context, but I wouldn't be surprised if there were some architectural decisions precluding that as an option. In lieu of that, this'd be sufficient for our use cases at least.
Thanks!
An aside: I'd love to find out that I'm wrong and there's a better way to do this, so please feel free to suggest something else!
Beta Was this translation helpful? Give feedback.
All reactions