watson / ci-info

Get details about the current Continuous Integration environment
MIT License
320 stars 49 forks source link

feat: add Github Actions support #43

Closed fearphage closed 4 years ago

fearphage commented 4 years ago

This is built on the excellent work by @ethomson in #42. It just seems to have gone dormant for about a month so I wanted to add the few review comments to get it over the line. I couldn't figure out how to push to the branch for that PR.

I centered the detection around the following environment variables:

This fixes #31.

ethomson commented 4 years ago

Hi @fearphage! I'm not sure that I saw the review comments in question.

But, in particular, you should be looking for GITHUB_ACTIONS, not GITHUB_ACTION. GITHUB_ACTION is set if and only if you are an action. (Terminology: an action is a modular, reusable component that can be run by many people's workflows, while a workflow is something that you set up in your repository to perform work like a build, deploy or some piece of repository automation.) So a typical workflow run would not have GITHUB_ACTION set.

GITHUB_ACTIONS is set, always, for workflows. It tells you that you're running in the context of GitHub Actions.

So we should be looking for GITHUB_ACTIONS here, not GITHUB_ACTION. The plural variable is always set, the former variable will not be set in peoples workflow runs.

fearphage commented 4 years ago

GITHUB_ACTIONS is set, always, for workflows. It tells you that you're running in the context of GitHub Actions.

As I asked in the previous PR, can you please link me to something confirming this? I cannot find GITHUB_ACTIONS (plural) in any documentation.

sagiegurari commented 4 years ago

@fearphage did you check your code via github actions and saw that it's missing? can you show a log/screenshot of that? if the answer is no, is there a good reason to ignore @ethomson explanation? i have to admit, i fail to understand why to create a new PR in the first place. you stated the PR is dormant, but to me it looks like the repo is dormant and a new PR doesn't help.

ethomson commented 4 years ago

As I asked in the previous PR, can you please link me to something confirming this? I cannot find GITHUB_ACTIONS (plural) in any documentation.

Right, sorry. We’re a bit behind with a few documentation updates. We should have this soon, apologies.

fearphage commented 4 years ago

i have to admit, i fail to understand why to create a new PR in the first place. you stated the PR is dormant, but to me it looks like the repo is dormant and a new PR doesn't help.

I didn't realize the repo wasn't been maintained. The PR had unresolved comments from 28 days ago so it looked abandoned. My goal is the functionality.

We’re a bit behind with a few documentation updates.

Understood. I'm more than happy to stick with your PR.

ethomson commented 4 years ago

My goal is the functionality.

Agreed! I don't think anybody thought otherwise, I appreciate the PR. 😀