My Workflow
You probably know about The Most Useless Machine:
Let’s build it in GitHub Actions!
Submission Category:
...
For further actions, you may consider blocking this person and/or reporting abuse
Would the new workflow dispatch trigger be a good alternative? You can make an action run on that event and exclude pushes etc. And you can trigger via UI button
github.blog/changelog/2020-07-06-g...
Yup, I would use
workflow_dispatch
when I want to run tasks on the default branch.(In fact, I have an article on this feature 😁)
Add this `.yml` file to your repo to give it a GitHub Actions-based shell
Thai Pangsakulyanont ・ Aug 19 ・ 2 min read
However, if I want to run tasks in context of a PR (or an issue) I think I’d still prefer a label approach.
Okay great thanks. I haven't used workflow dispatch yet so I'll check that out
Congrats Thai. I have zero knowledge of github actions though. Any resource you'd recommend?
Thanks!
There are many helpful resources on DEV.to but in my opinion the most important resource is GitHub’s official documentation.
You can think of GitHub Actions as like having a brand new computer that can automate things for you based on what happens and what's inside your GitHub Repository. To automate things in your computer you would write shell scripts. So it’s good to also learn the common command-line tools.
For example, consider the command I showed in this post:
You can’t find that command in GitHub Docs, but crafting that command takes these knowledge:
$GITHUB_REPOSITORY
environment variablegithub.event
andsecrets
contexts available as expressionsGITHUB_SECRET
secret and that it can be used with GitHub’s API (with some restrictions)DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}
endpoint removes a label from an issuecurl
is a commonly available command (other commands can be used too, but I just chose curl because that’s what I’m most familiar with).-X
is used to specify the HTTP method.As you can see just learning from the official documentation may not be enough.
But unlike other systems that requires some setup on a 3rd party service, with GitHub Actions, all you need is a repository and a workflow file. Getting my hands dirty is the most effective way for me to learn something. So, I recommend creating small projects/repositories to try out GitHub Actions on. Here are some of mine:
this comment could be a post in itself, the documentation is great and very accurate but real examples of how we should use it seem a bit lacking. great posts thanks for making them
I wrote a post on this:)
dev.to/michaelcurrin/beginner-s-gu...
Oooo this is nice! Very creative way to trigger workflows
lol "CSS Layout destroyer" in your description indeed overflows on mobile 🤣
One duty of a CSS layout destroyer is to fill in forms with non-breaking spaces instead of regular ones. 😂
This made me laugh lol
Very neat!!