A VS Code extension that automatically pins GitHub Actions to specific commits for enhanced security.
⚠️ Experimental Project: This extension is entirely experimental and was written by Claude Code. Use at your own discretion.
- Automatic Pinning: Updates GitHub Actions to use commit hashes instead of version tags
- Latest Version Detection: Finds the highest semantic version and pins to its commit
- Private Repository Support: Configure GitHub token for private repositories
- Skip Pinning: Use
# skip-pinningcomment to exclude specific actions - Comprehensive Updates: Updates entire workflow file at once
- Error Handling: Continues processing other actions if one fails
Run the following in the edit prompt (ctrl+shift+p)
ext install github-workflow-updater.github-workflow-updater
Click cursor:extension/github-workflow-updater.github-workflow-updater
open-vsx Visual Studio Code Marketplace
- Open a GitHub workflow file (
.ymlor.yaml) - Click the sync button in the editor toolbar
- The extension will update all actions to their latest pinned versions
Set your GitHub Personal Access Token in VS Code settings:
GitHub Workflow Updater: Github Token
This token is required for accessing private repositories and helps avoid rate limits.
To prevent an action from being updated, add a # skip-pinning comment:
- uses: actions/checkout@main # skip-pinningBefore:
- uses: actions/checkout@v4
- uses: actions/[email protected]After:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # tag v4.2.2
- uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # tag v4.0.0- VS Code 1.74.0 or higher
- Internet connection for GitHub API access
This extension enhances security by:
- Pinning actions to specific commits prevents supply chain attacks
- Immutable references ensure consistent behavior
- Following security best practices from StepSecurity
-
Install dependencies:
npm install
-
Compile TypeScript:
npm run compile
Or watch for changes during development:
npm run watch
-
Open in your editor: Open this project folder in VS Code or Cursor
-
Launch Extension Development Host:
- Press
F5or use the "Run and Debug" panel - Select "Run Extension" configuration
- This opens a new window with the extension loaded (VS Code window if using VS Code, Cursor window if using Cursor)
- Press
-
Test the functionality:
- In the Extension Development Host window, open a GitHub workflow file (
.ymlor.yaml) - Click the sync button in the editor toolbar
- The extension should update actions to pinned versions
- In the Extension Development Host window, open a GitHub workflow file (
-
Refresh the Extension Development Host: After making code changes, you need to refresh the Extension Development Host:
- Method 1: Use Command Palette (
Cmd+Shift+Pon Mac,Ctrl+Shift+Pon Windows/Linux)- Type "Developer: Reload Window" and select it
- Method 2: Close and reopen the Extension Development Host window (press
F5again) - Method 3: Use the restart button in the Debug toolbar
- Note: In Cursor on macOS, the Extension Development Host works the same as VS Code
- Method 1: Use Command Palette (
npm testnpm install -g vsce
vsce packageThis creates a .vsix file that can be installed in VS Code or Cursor.
This extension is not yet published to the marketplace.
-
Download or build the extension:
- Either download a
.vsixfile from releases - Or build it yourself following the Development section above
- Either download a
-
Install the
.vsixfile:- Open VS Code or Cursor
- Press
Cmd+Shift+P(Mac) orCtrl+Shift+P(Windows/Linux) - Type "Extensions: Install from VSIX..."
- Select the
.vsixfile - Restart your editor
-
Configure GitHub token (optional but recommended):
- Go to Settings (Code → Preferences → Settings)
- Search for "GitHub Workflow Updater"
- Set your GitHub Personal Access Token
For Classic Personal Access Tokens, you need:
public_repo- Access public repositoriesrepo- Full access to private repositories (if you need private repo access)
For Fine-grained Personal Access Tokens, you need:
- Repository permissions:
Contents: Read- Read repository files and metadataMetadata: Read- Read repository metadata (required)Actions: Read- Read workflow files (if accessing Actions)
Note: Fine-grained tokens must be configured for each organization/repository you want to access.
If you see errors like:
Failed to update tesslio/github-workflows/.github/workflows/production-deploy.yml: Error: GitHub API error: 404 - {"message":"Not Found"}
This typically means:
-
Reusable workflows: For reusable workflows like
owner/repo/.github/workflows/workflow.yml@ref, the extension now correctly extracts just the repository name (owner/repo) for API calls while preserving the full path in updates. -
Sub-actions: For GitHub Actions with sub-actions like
actions/cache/restore@reforactions/cache/save@ref, the extension now correctly extracts the base repository name (actions/cache) for API calls while preserving the full sub-action path in updates. -
Private repository access: If the repository is private, ensure your token has access:
- For fine-grained tokens: Add the repository to your token's repository access list
- For classic tokens: Use the
reposcope instead ofpublic_repo
-
Organization permissions: For organization repositories with fine-grained tokens, the organization must approve your token
-
Repository name format: Ensure actions use the correct format:
owner/repo@version(not file paths)