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

Support for :workflow_file_name #2

Closed
cedriclevarlet opened this issue Feb 16, 2020 · 9 comments · Fixed by #39
Closed

Support for :workflow_file_name #2

cedriclevarlet opened this issue Feb 16, 2020 · 9 comments · Fixed by #39

Comments

@cedriclevarlet
Copy link

It would be great if this action could allow for :workflow_file_name as an alternative to :workflow_id.

This seems to be support by the API and github's javascript library as specified in https://developer.github.com/v3/actions/workflows/#get-a-workflow and would avoid having to make seperate API calls to find out the ID.

@styfle
Copy link
Owner

styfle commented Feb 16, 2020

I tried using the name and it didn’t work when I created this repo. I’ll have to try again to see if it works with the name.

Also, I kinda like the ID to avoid the situation when a workflow is renamed and the cancel action breaks.

Lastly, “name” is ambiguous because it could mean the yml file name or the name property defined in the file.

@rosenbjerg
Copy link

rosenbjerg commented Feb 27, 2020

You could use the GITHUB_ACTION environment variable documented here: https://help.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables#default-environment-variables
And we could avoid providing id completely and still be resistant to renaming.

Edit: I guess I could also just use that as the value for the input argument.
I still think it would be nice to not have to provide it

@styfle
Copy link
Owner

styfle commented Feb 27, 2020

I don't think GITHUB_ACTION will work because the purpose of this workflow is to run along side and cancel other workflows.

See the Usage in the readme for an example. The cancel.yml would cancel another yml workflow.

Also see this repo which uses this pattern: https://github.com/styfle/cancel-workflow-action/tree/master/.github/workflows

@rosenbjerg
Copy link

Ah, I see

@buremba
Copy link

buremba commented May 13, 2020

It would be great if we can support this feature. We're programmatically creating the workflow files and commit them into the repositories so we need to commit, perform an API call in our app from the master to Github API and use the id in order to perform another commit which is a bit painful.

Not sure which API tried but in our tests, the API accepts a workflow file name in addition to IDs. Can you please try if that's the case for you?

@mxcl
Copy link

mxcl commented May 27, 2020

Couldn’t we put this inside the workflow we want to cancel and then have it know to cancel itself? Otherwise renaming workflows will have unexpected side-effects.

@buremba
Copy link

buremba commented May 27, 2020

@mxcl Workflow actions have access to the info of the changed files so in case a file is renamed, we can find out the previous name and cancel the actions.

@styfle
Copy link
Owner

styfle commented Jun 8, 2020

In version 0.4.0, you no longer need to provide a workflow id.

Does this solve the original problem?

@rosenbjerg
Copy link

@styfle That is exactly the functionality I was asking for :)

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 a pull request may close this issue.

5 participants