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 use case examples to README #1

Open
abinoda opened this issue Jan 25, 2019 · 8 comments
Open

Add use case examples to README #1

abinoda opened this issue Jan 25, 2019 · 8 comments
Labels
help wanted Extra attention is needed

Comments

@abinoda
Copy link
Owner

abinoda commented Jan 25, 2019

It'd be nice to add a full example workflow, e.g. posting messages about opened and merged pull requests to a Slack channel.

@abinoda abinoda added the help wanted Extra attention is needed label Jan 25, 2019
@mrcasals
Copy link

mrcasals commented Feb 4, 2019

Hi!

Coming from https://github.community/t5/GitHub-API-Development-and/GitHub-Actions-get-the-PR-ID-that-started-it/m-p/18444#M812

My use case is this: since GitHub notifications is kinda messy and it's hard to notice that something's happened, I want to be able to send a message on Slack when a PR is open. The message should, at last, include the link to the PR and the GitHub user that opened it.

@mrcasals
Copy link

mrcasals commented Feb 4, 2019

As explained on the link, maybe we could create an action that sets env variables based on the contents of the GITHUB_EVENT_PATH file, and use those variables as arguments for your action.

Maybe something like MY_VAR "json.path[0].to.relevant.content", this would use jq to get the specified contents of the file and set the value to MY_VAR env variable. Then in I'd use $MY_VARV as inputs of this image.

@abinoda
Copy link
Owner Author

abinoda commented Feb 4, 2019

@mrcasals

Makes sense. Yeah, I'm working on a way to allow flexible event object access via the arguments to this GitHub Action. So the arg could be something like New pull request opened: ${pull_request.title}, and the Action would automatically parse the argument and attempt to substitute the event object value for ${pull_reqeust.title}.

Does that make sense? Let me know your thoughts.

@mrcasals
Copy link

mrcasals commented Feb 5, 2019

Yeah, makes sense!

@abinoda
Copy link
Owner Author

abinoda commented Feb 5, 2019

@mrcasals

I think this will be difficult to do without the ability to filter workflows to specific event actions as described here. It looks like GitHub is working on this, though. cc: @jessfraz

@mrcasals
Copy link

mrcasals commented Feb 6, 2019

There's a GitHub action for this:

action "On review submission" {
  uses = "actions/bin/filter@c6471707d308175c57dfe91963406ef205837dbd"
  args = "action submitted"
}

https://github.com/actions/bin/tree/c6471707d308175c57dfe91963406ef205837dbd/filter

@jjangga0214
Copy link

May I ask if this issue is still valid?

@eedwards-sk
Copy link

eedwards-sk commented Dec 12, 2019

What happened to this issue?

The linked issue about needing env var support is still valid, yet was closed in favor of this.

Edit: Ahh, just looked at the source. This project is a joke -- it's literally just wrapping a single curl command. Not even worth using as an action.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants