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:
that pull requests are also issues, and therefore the API endpoints that work with issues also work with pull requests
Knowledge about making an HTTP request from the command line
that curl 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).
that -X is used to specify the HTTP method.
Knowledge about shell script
that we can put environment variables inside double-quoted strings
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:
github-actions-tsc-problem-matcher... In this project I want to set up GitHub Actions so that it displays compile-time errors in the “Files Changed” tab.
action-rotating-light In this project I want to ban a certain word/emoji from the project. For example I picked 🚨 as the forbidden emoji because I use it to mark code as “still unfinished, need to come back and fix this before merging.”
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
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
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