The security default we change in GitHub's checkout action
Most of our GitHub workflows pull in actions/checkout and never touch its inputs.
That is fine most of the time, but one input matters a lot for security.
It is persist-credentials.
These entries have all been tagged with “github”.
Most of our GitHub workflows pull in actions/checkout and never touch its inputs.
That is fine most of the time, but one input matters a lot for security.
It is persist-credentials.
GitHub actions are awesome. In fact, we often write about them or share details on MasteringLaravel.io in the tips section or the community.
Let’s take a look at one particular workflow that appears pretty simple - after you understand it all.
How do we merge from develop into main for a production deploy or merge? By using this GitHub action.
You’re using Pull Requests in GitHub and everything is working great! Nice workflow! But now you have a problem: deploying from develop to main via a … what? A PR? A merge commit if you bring the two branches down to your local machine? What else? What about a GitHub action that you can use to do this? Here’s a simple proof of concept with explanation - you may still need to alter this for your workflow.
I can’t say how much I love GitHub actions. It really felt like a game-changer for me. But I always had some concerns about security. How do we stop 3rd party actions from accessing stealing our code?
Let’s say you have a domain you’re not going to use anymore that has to do with web development. What should you do with it? Obviously write some JS to redirect that domain to a random GitHub user’s profile, right? Let me show you how.
I had a nightmare that someone had access to my GitHub account and was deleting every repo I had before my eyes. I couldn’t figure out how to stop them and invalidate the proper token. I woke up and decided that I am not ok with this one point-of-failure of my historical work. So I wrote a script to back it up.
This article will break down how I use GitHub Actions and GitHub Pages to retrieve data from an API, commit the new data to my repo, and have GitHub pages rebuild and use that data - all on a schedule with no hands-on interaction.