-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 detection and update the Pulumi CI escape hatch with more CI vars #4758
Conversation
func (t githubActionsCI) DetectVars() Vars { | ||
v := Vars{Name: GitHubActions} | ||
v.BuildID = os.Getenv("GITHUB_RUN_ID") | ||
v.BuildNumber = os.Getenv("GITHUB_RUN_NUMBER") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// See https://help.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables#default-environment-variables. | ||
func (t githubActionsCI) DetectVars() Vars { | ||
v := Vars{Name: GitHubActions} | ||
v.BuildID = os.Getenv("GITHUB_RUN_ID") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the ID that goes in the URL. For example, https://github.com/pulumi/docs/actions/runs/126408154.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
|
||
// DetectVars detects the GitHub Actions env vars. | ||
// nolint: lll | ||
// See https://help.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables#default-environment-variables. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: We can probably trim off the #default-environment-variables.
part.
0bad44a
to
d4bd56e
Compare
This PR adds the detection logic for GitHub Actions. I have also updated our escape-hatch code for unknown CI systems to allow users to set all CI vars that we support today.
This PR might address the problem reported in #4613.