Skip to main content
To defend against attacks and tampering of GitHub Actions, the official Laravel projects implement a critical security measure: pinning Action dependencies to commit hashes. This page explains the practical approach package developers should adopt.
This page is a companion to Package Development Basics. It assumes you’re familiar with GitHub Actions basics.

Security Risks of GitHub Actions

Dangers of Tag-Based References

Most GitHub Actions are referenced by tags:
Problems with this approach:
  • Tags are mutable — Tags can be deleted and recreated with the same name
  • Tampering risk — If an action’s repository owner is compromised, malicious code can be injected
  • Supply chain attacks — If a dependency is attacked, your workflow becomes vulnerable

How Official Laravel Projects Respond

laravel/laravel and laravel/framework pin all actions to full commit hashes (SHAs).

Implementation Strategy

Step 1: Create Dependabot Configuration

Create .github/dependabot.yml in your repository. You can copy Laravel’s file directly:
This file:
  • Scans automatically — Detects new GitHub Action versions
  • Creates update PRs — Proposes changes when updates are available
  • Controls update method — Unpinned actions update by version; pinned actions update by SHA

Step 2: Pin Existing Actions to SHAs

Convert all action references in your workflows to commit hashes. Use pinact to automate this.

Using the pinact Tool

Manual Approach

If pinact is unavailable, look up commit SHAs on each action’s latest version page and update manually:

Step 3: Enable Dependabot Configuration

Commit and push .github/dependabot.yml to your repository. Dependabot will automatically begin scanning.

How Dependabot Updates Work

Dependabot applies different update strategies based on your dependabot.yml configuration:

Unpinned Actions

Dependabot’s update: Updates the version range to a new version
This prioritizes convenience and handles tag movement, but security risks remain.

Pinned Actions

Dependabot’s update: Updates the commit hash to the new version’s hash
This is the most secure approach. Even with new versions, SHA references protect against tampering.

Complete Workflow Example

A comprehensive example using multiple actions:

Responding to Dependabot Update PRs

Handle Dependabot’s automated update PRs appropriately:

Single Action Updates

For straightforward updates:
  1. Review workflow execution results
  2. Check for breaking changes
  3. Merge and close

Security Update PRs

Prioritize security fixes and merge immediately.

Grouped Multi-Action Updates

With groups configured in dependabot.yml, multiple actions update in a single PR:
Grouping reduces merge overhead.

Benefits and Tradeoffs

Benefits

Tradeoffs

Security Audit Checklist

Use this checklist when starting a new package project:
  • Create .github/dependabot.yml
  • Pin all existing actions to SHA
  • Verify with pinact or manually
  • Confirm workflows execute successfully
  • Review Dependabot update PRs weekly
  • Prioritize security updates for immediate merge
  • Pin new actions to SHA when added
  • Monthly: Review all workflow status
  • All action references are SHA-based
  • Dependabot is enabled
  • Last 6 months of Dependabot PRs are merged

Package Development Basics

Learn about Laravel package development with service providers at the core.

Package Version Compatibility

Explore strategies for supporting multiple Laravel versions in your package.
Last modified on June 13, 2026