Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GitHub Actions support #42

Merged
merged 1 commit into from
Feb 11, 2020
Merged

Conversation

ethomson
Copy link
Contributor

Add support for detecting a run inside a GitHub Actions environment. This detects using the GITHUB_ACTIONS environment variable, and detects a pull request run by examining the GITHUB_EVENT_NAME environment variable, which indicates why a GitHub Actions run was started. When it is set to pull_request, we set isPR to true.

@ethomson
Copy link
Contributor Author

Fixes #31

@fishcharlie
Copy link

Awesome!!! @watson any chance we could get this merged in?

Copy link

@codfish codfish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

think there may be a typo

{
"name": "GitHub Actions",
"constant": "GITHUB_ACTIONS",
"env": "GITHUB_ACTIONS",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, GITHUB_ACTION is set to the name of the action that’s running (if there is one). For example, action/setup-node@v1.

GITHUB_ACTIONS is set always. I’ll put in a PR to the docs to reflect this.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not seeing the GITHUB_ACTIONS (plural) referenced anywhere. Can you share a link to that documentation?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry about the delay, we don't have the documentation update live yet.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GITHUB_ACTIONS is now documented here

@codfish
Copy link

codfish commented Sep 15, 2019 via email

@fearphage
Copy link

@watson Is this missing anything else or can it be merged?

Copy link

@mislav mislav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thank you @ethomson!

t.equal(ci.GITHUB_ACTIONS, true)
assertVendorConstants('GITHUB_ACTIONS', ci, t)

delete process.env.GITHUB_ACTIONS
Copy link

@mislav mislav Nov 5, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might want to perform this global teardown in a finally block in case any of the previous steps throw.

@fishcharlie
Copy link

Now that GitHub Actions is generally available (https://github.blog/changelog/2019-11-11-github-actions-is-generally-available/) can we get this merged with a new release @watson???

@yordis
Copy link

yordis commented Nov 29, 2019

@watson give us some love 💘

@fearphage
Copy link

FYI I emailed the maintainer directly over two weeks ago. Haven't heard a peep. I'm not sure how to proceed from there.

@jperl
Copy link

jperl commented Jan 4, 2020

I published a fork with this merged in case anyone needs this in the meantime. @qawolf/ci-info

@fearphage
Copy link

@sibiraj-s Do you still have merge access? I see you merged the last commit in the repo. We're trying to get some motion on this PR.

@sibiraj-s sibiraj-s merged commit 8efa868 into watson:master Feb 11, 2020
@ethomson
Copy link
Contributor Author

ethomson commented Feb 11, 2020

Cool, thanks @sibiraj-s! Now how can we get a release shipped?

@fearphage
Copy link

@sibiraj-s Thank you. You're a star.

Now how can we get a release shipped?

Related: Have you seen #44?

@sibiraj-s
Copy link
Collaborator

I don't have publish access, I have notified reg this to @watson.

meanwhile i will look into other Issues/PR and get them ready so it can be published whenever possible.

For now (till the new changes are published)

npm install https://github.com/watson/ci-info.git

@fearphage
Copy link

I don't have publish access, I have notified reg this to @watson.

Unless you know @watson personally, that may be a dead end. This issue was code complete since 9/19. I reached out to him via email 3 months ago and twitter 1.5 months ago about this exact issue. He didn't reply to either. I honestly considered the fact that he might be dead until he retweeted his company a few days ago. I suspect he has simply lost interest in the project. I would love to see him hand the reins over to someone else, but alas here we are.

@mislav
Copy link

mislav commented Feb 17, 2020

I honestly considered the fact that he might be dead until he retweeted his company a few days ago. I suspect he has simply lost interest in the project.

I don't think it's nice to say something like that. Open source projects are provided without warranties and any maintainer can step down at any time they want. It's much kinder to assume the priorities of how the maintainer spends their free time has changed.

I would love to see him hand the reins over to someone else

Speaking from a perspective of a maintainer myself, that's way easier said than done, especially for a project that has this many weekly downloads and dependents. We can't hand over a project to just anyone because we can't be sure that they don't have malicious intent with future releases, or that the new maintainer's own security & release practices match ours.

@fishcharlie
Copy link

@mislav I completely agree that it’s very extreme and not nice to assume the worst when people are no longer active.

That being said. GitHub provides a very simple archive feature that @watson COULD use to indicate the project is no longer being maintained. Or a simple edit to the README as well. It’s totally fair that priorities change, but maintainers should at least respect the community enough to spend 1 minute informing the community of the priority change.

@fearphage
Copy link

I don't think it's nice to say something like that.

@mislav Thinking someone is dead is neutral. Death is merely a state of being. I didn't wish death upon him. I said it may be the case. Humans have a tendency to die... at a rate of 100% as observed thus far.

Open source projects are provided without warranties and any maintainer can step down at any time they want. It's much kinder to assume the priorities of how the maintainer spends their free time has changed.

You are 100% correct. However even the busiest man in the world has the time to say "I don't want to support this anymore", "leave me alone", "die in a fire", or any kind of response at all honestly. I assumed the radio silence to Github, email, and Twitter meant something more sinister was at play. Since I'm unable to imagine someone that can't find under 30 seconds to type a handful words, it seemed like a much nicer assumption than to assume he was merely ignoring us all intentionally. I'm an optimist so I was assuming the best of the maintainer and that this silence was beyond his control.

@aslafy-z aslafy-z mentioned this pull request Jul 8, 2020
@huan
Copy link

huan commented Oct 26, 2020

I'm running GitHub Actions and want to use ci-info for it.

However, it seems that this PR has not been published to NPM yet.

Could we publish the latest code to npm for convenience?

@sibiraj-s
Copy link
Collaborator

Published v3.

huan added a commit to wechaty/puppet-official-account that referenced this pull request Feb 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants