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:- 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:
- 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
Ifpinact 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 yourdependabot.yml configuration:
Unpinned Actions
Pinned Actions
Complete Workflow Example
A comprehensive example using multiple actions:Responding to Dependabot Update PRs
Handle Dependabot’s automated update PRs appropriately:Single Action Updates
- Review workflow execution results
- Check for breaking changes
- Merge and close
Security Update PRs
Grouped Multi-Action Updates
Withgroups configured in dependabot.yml, multiple actions update in a single PR:
Benefits and Tradeoffs
Benefits
| Benefit | Description |
|---|---|
| Supply chain protection | References specific commit hashes, resistant to action tampering |
| Auditability | Track exactly when and to what version each action was updated |
| Explicit updates | Dependabot requires human review before changes |
| Reproducibility | Same commit hash = identical environment every run |
Tradeoffs
| Tradeoff | Solution |
|---|---|
| Initial manual setup | Use pinact for automation |
| Update overhead | Dependabot automates PR creation, minimizing work |
| Readability | Include version in comments for clarity |
Security Audit Checklist
Use this checklist when starting a new package project:Initial Setup
Initial Setup
- Create
.github/dependabot.yml - Pin all existing actions to SHA
- Verify with
pinactor manually - Confirm workflows execute successfully
Ongoing Maintenance
Ongoing Maintenance
- Review Dependabot update PRs weekly
- Prioritize security updates for immediate merge
- Pin new actions to SHA when added
- Monthly: Review all workflow status
Audit
Audit
- All action references are SHA-based
- Dependabot is enabled
- Last 6 months of Dependabot PRs are merged
Related Pages
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.