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

Retrieve action version #494

Open
averikitsch opened this issue Jun 5, 2020 · 4 comments
Open

Retrieve action version #494

averikitsch opened this issue Jun 5, 2020 · 4 comments
Labels
enhancement New feature or request github

Comments

@averikitsch
Copy link

Describe the enhancement
Method or an environment variable to retrieve action version specified in workflow.

Code Snippet
workflow.yml:

steps:
    - uses: actions/my-action@v2

action code:

const version = core.actionVersion();
// OR
const version  = process.env.ACTION_VERSION

Additional information
This is useful when collecting usage statistics.

@thboop
Copy link
Collaborator

thboop commented Jun 25, 2020

cc @TingluoHuang , I like this idea, what do you think about incorporating it into the Runner so that we can consume it?

Keep in mind that we support a number of different ways to specify what version of an action to download.

  • SHA
  • tag
  • branch

Some of these are immutable (sha's), while others could change (branches or tags). Would it be helpful to expose two values, one that points to the version requested by the user, the other the sha it resolves to?

For example for the input

steps:
    - uses: actions/my-action@v2

we would provide

GITHUB_ACTION_VERSION = v2
GITHUB_ACTION_SHA = 7a1a0dd6fcb0fd35ec32d445689039886ad1a252

if a user requested by sha, they would get

steps:
    - uses: actions/my-action@7a1a0dd6fcb0fd35ec32d445689039886ad1a252

we would provide

GITHUB_ACTION_VERSION = 7a1a0dd6fcb0fd35ec32d445689039886ad1a252
GITHUB_ACTION_SHA = 7a1a0dd6fcb0fd35ec32d445689039886ad1a252

@thboop thboop added the github label Jun 25, 2020
@gndelia
Copy link

gndelia commented Sep 12, 2020

I'd like to work on this one in the incoming days/weeks. Is it taken? 👀

@cristiangreco
Copy link

Hey 👋 would be super useful to access information about the ref of the action being executed. Any chance you guys are going to pick up this work? Thanks!

@gndelia
Copy link

gndelia commented Sep 28, 2020

I had no answer above, but I'll give it a try - in the worst scenario this ends up in a PR that's not merged 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request github
Projects
None yet
Development

No branches or pull requests

4 participants