-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Add GITHUB_REF_TYPE and GITHUB_REF_NAME support to github context #935
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
base: main
Are you sure you want to change the base?
Conversation
Why don't you add cf. https://docs.github.com/en/actions/learn-github-actions/environment-variables |
Done. :) |
@peaceiris can we merge this ? |
@@ -40,6 +43,9 @@ export class Context { | |||
this.eventName = process.env.GITHUB_EVENT_NAME as string | |||
this.sha = process.env.GITHUB_SHA as string | |||
this.ref = process.env.GITHUB_REF as string | |||
this.refName = process.env.GITHUB_REF_NAME as string | |||
this.refType = process.env.GITHUB_REF_TYPE as string | |||
this.refProtected = (process.env.GITHUB_REF_PROTECTED as string) === 'true' |
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.
The GITHUB_REF_PROTECTED
is expected to have true, so I think the current implementation is sufficient. We need the opinion of the maintainers about this.
cf. https://docs.github.com/en/actions/learn-github-actions/environment-variables
LGTM |
How to get the approval from actions/actions-runtime? Seems it is the only thing left before merge. |
Hope it is all changes required to pass ref_type info from env to github context.
It's first time I touch actions toolkit and I'm not sure if I hadn't miss something.