GitHub Actions in 2026: How To Securely Automate Your Code
If you open the settings on virtually any modern piece of software you will see GitHub Actions is used. It has become the go-to automation system for a large proportion of the open source and commercial world. It turns GitHub into an end-to-end CI/CD solution meaning you can no longer have a separate Jenkins server or external scripts to build, test and deploy your software. However, due to just how widespread GitHub Actions is, you may not realise that its lack of hardening can turn into a remote code execution vulnerability.
This guide is aimed at developers, DevOps engineers and technical founders who want to understand how to use GitHub Actions in 2026 to secure your code and not create an incident. We’ll cover the current feature set, price changes in 2026, a hardening checklist and walk through creating a custom action with notifications.
What GitHub Actions Actually Is
GitHub Actions is an event driven automation system. You can create workflows using YAML files within your repository. These workflows can be triggered by a variety of events including push, pull request, issue comment, schedule and external webhooks. These workflows run using runners which can be either hosted by GitHub or self-hosted. Jobs within workflows consist of steps. These steps can either be a shell command or an action. An action is a reusable piece of code within a repository.
The reason GitHub Actions won is because it means you don’t have to set up a separate system to use. There’s no setting up SSH keys. The workflow has access to the repository, pull request and issue tracking because it is all within the same platform.
However, this is why there is a risk. The workflows are executing arbitrary code with access to your secrets, source code and cloud credentials. An example of this was the tj-actions/changed-files compromise in March 2025 (CVE-2025-30066). Attackers pushed malicious code into an action and then retagged the existing version tags. Any workflow that used @v35 or similar tag would automatically begin leaking memory from the runner and secrets into the build logs. This resulted in around 23,000 repositories being exposed. The lesson here is not to avoid using third party actions. Instead, understand what your workflows have access to, what code they are trusting and where they can go.
GitHub Actions Features In 2026
GitHub Actions in 2026 has had several changes.
Agentic Workflows was released in public preview in June 2026. The biggest change for GitHub Actions. You can now create your automations using natural language. These markdown files get converted into standard Actions YAML. The workflows make use of coding agents to complete reasoning based tasks such as triaging issues, analysing CI failures and updating documentation. By default, the agents will have read only access. They will run within a container and be protected by the Agent Workflow Firewall. Any changes the agent wants to make will go through a safe outputs process. A dedicated threat detection job will analyse everything. This has been adopted by companies such as Carvana and Marks & Spencer and has reduced repetitive engineering work from hours to minutes.
OIDC tokens can now use repository custom properties. This is a small but important security improvement. OpenID Connect (OIDC) has been the advised method of authenticating to cloud providers without having long lived secrets. From April 2026, the OIDC tokens can now include repository custom properties as claims. This means we can create trust policies based on the environment, team or compliance level rather than listing out repositories. This means we can have a centralised control for accessing the cloud based on our organisations governance.
Service containers can now be overridden. This is a nice to have change. You can now override the entrypoint and command for your service containers within your workflow YAML. This uses the same syntax as Docker Compose. If you’ve ever had issues with your database container not starting with the correct configuration, this is the feature for you.
Node.js 24. GitHub have made some breaking but necessary changes to the runtime. JavaScript actions are now using Node.js 24. If you have any custom actions or old third party actions, ensure they are compatible.
GitHub Actions Pricing In 2026
There are some positive changes to the pricing.
GitHub hosted runner prices have been reduced by up to 39%. This came into effect on Jan 1st 2026. Free minutes are still the same. The standard Linux x64 runners now cost $0.006 per minute for 2-core machines, $0.012 (4 core) and $0.022 per minute for 8-core, and $0.042 (16 core). The macOS runners are expensive at $0.062 (3-4 core).
We still get some free minutes. For private repositories you get 2000 (Free), 3000 (Pro/Team) and 50,000 (Enterprise Cloud). The standard runners for public repositories are free. Larger runners will always be charged.
The self-hosted runner charge has been delayed. Originally, GitHub announced that they would charge $0.002 per minute for using self-hosted runners for private repositories. However, they decided to delay this change and rethink their approach. They admitted they "missed the mark by not including more of you in our planning". The price reduction for the hosted runners has still gone through. The lesson here is that self-hosted runners still use GitHub’s control plane infrastructure and the charging model is likely to change.
The most common way teams accidentally burn money is through matrix builds. Adding an extra dimension to your build will cause it to explode. Adding 3 OS’s, 4 Node versions and 4 databases will cause 48 separate jobs to be created. One poorly configured matrix can cause you to be charged $10,000 to $50,000 in unexpected CI costs per month. To prevent this, limit the matrix size using a CI check. Cache aggressively using actions/cache. Size your runners based on the speed up you get. Don’t run your full test suite for every pull request. Use a 2-stage CI.
Hardening Checklist
The security of your GitHub Actions workflow depends on how you set up your YAML. Below is a list of hardening tips that have been used in production during multiple rollouts in 2026.
Always pin third party actions to a full commit hash. Tags such as @v4 can be changed. If the maintainer of the action gets compromised or the attacker accesses the action repository, they can change the code the tag points too. Always pin to the 40 character commit hash. Add a comment so you know what version it is. Use Dependabot or Renovate to flag up any PR’s that will bump the commit hash. Treat these as security changes.
Limit the GITHUB_TOKEN to read only. Since 2023 new repositories default to read only. However, many existing repositories and organisation policies will give wide write access. Set a minimum at workflow level. Only give write access to the job that requires it.
Don’t ever run untrusted code with secrets. The most damaging vulnerabilities in GitHub Actions come from the pull_request_target event. This means the workflow will have access to the secrets of the base repository. If the workflow runs and checks out code from an incoming fork, the attacker can exfiltrate all the secrets the workflow has access too. Use the pull_request event for anything that builds or tests fork code. This has no secrets. If you must use pull_request_target, never checkout the head ref.
Replace long lived cloud secrets with OIDC. Having a static AWS/GCP key in your repository secrets will mean you’ve permanently compromised your system. Using OIDC you can use a short lived signed token to get a credential from the cloud. This will only last for minutes and is tied to a specific workflow run. The trust policy on the cloud can be set to only allow specific branches, environments or jobs.
Use environments for production. Any workflows that touch production should be run in a GitHub Actions environment. This will enforce protection rules such as required reviewers, wait time and only allowing invocation from main. Secrets will only be available to the environment so the staging workflow can’t accidentally read production secrets.
Isolate self-hosted runners. Unlike GitHub hosted runners, self-hosted runners will not have the clean VM. If you’re using self-hosted runners, ensure they are isolated from sensitive networks. Don’t use them for any untrusted workloads. Assume any secrets the runner has access to could be exposed.
Creating A Custom Action
The most common reason teams will create custom actions is because they want to run a specific linter, deploy somewhere internally or wrap a third party API. The process is simple.
To create a JavaScript action you need three files: action.yml (defines the inputs and outputs), package.json (lists dependencies such as @actions/core and @actions/exec) and compiled index.js. A simple example would be to create a linter that runs npm run lint. However, a production ready action should have error handling so if the linter fails we fail the job. If there is an issue with the tooling we can retry.
A much more important consideration is what your action shouldn’t do. Don’t include secrets. Don’t assume the working directory. Don’t write to the repository unless it’s to commit. The safest custom actions are the ones with the least surface area. They take inputs, run a command and return an output.
Takeaways
GitHub Actions is a huge part of how we operate software today. It is now the default CI for a large proportion of both open source and commercial. This is because it integrates so well. It is flexible and has lots of new features. Agentic Workflows, OIDC custom properties and service container overrides are all genuine improvements.
However, because it is so widespread it can become a target. Teams who use GitHub Actions well in 2026 will treat the YAML as production code. This will be reviewed, pinned, have permissions and monitored. Teams who get caught out will copy a workflow from a blog, use @v4 as it looks neat and eighteen months later find out the tag has been retagged and their secrets are in the build logs.
The platform provides the tools. Follow the hardening checklist. Understand the price changes. Create custom actions. Remember, every action you add is code you’re trusting to run with access to everything the workflow can. Be aggressive with automation but deliberate with what you trust.
Related Posts
Domain and Web Hosting in 2026: The Renewal Trap, the TTFB Truth, and Other Ways You Will Be Overcharged
The 83% Migration Failure Rate Is Your Business Model: How To Build A Freelance Business Around Cloud Migration Projects
The $12,000 6 Month MVP - Why ‘Full-Stack’ is the Most Expensive Word You Can Put On Your Fiverr Profile
The Retirement Problem Nobody Budgeted For: What Happens to a Business When the Only Person Who Understood the Code Leaves

Comments
Post a Comment