Add shell plugin for Netlify CLI#627
Open
eddumelendez wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces a new 1Password Shell Plugin for the Netlify CLI that provisions NETLIFY_AUTH_TOKEN from a stored Personal Access Token, enabling authenticated Netlify CLI usage without storing tokens in shell configuration.
Changes:
- Added a new
netlifyplugin definition with platform metadata and executable configuration. - Implemented a Personal Access Token credential type that provisions/imports via
NETLIFY_AUTH_TOKEN. - Added unit tests for the credential provisioner and importer.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| plugins/netlify/plugin.go | Declares the Netlify plugin and wires credentials + executable into the plugin schema. |
| plugins/netlify/netlify.go | Defines the Netlify CLI executable and its NeedsAuth rules plus credential usage. |
| plugins/netlify/personal_access_token.go | Implements the Personal Access Token credential type with env-var provision/import mapping. |
| plugins/netlify/personal_access_token_test.go | Adds tests validating env-var provisioning and importing for NETLIFY_AUTH_TOKEN. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+14
to
+20
| ItemFields: map[sdk.FieldName]string{ | ||
| fieldname.Token: "kV9wTq3ZtN0aB4cD7eF1gH5iJ8kL2mN6oP0qR4sT8uV", | ||
| }, | ||
| ExpectedOutput: sdk.ProvisionOutput{ | ||
| Environment: map[string]string{ | ||
| "NETLIFY_AUTH_TOKEN": "kV9wTq3ZtN0aB4cD7eF1gH5iJ8kL2mN6oP0qR4sT8uV", | ||
| }, |
Comment on lines
+29
to
+36
| Environment: map[string]string{ | ||
| "NETLIFY_AUTH_TOKEN": "kV9wTq3ZtN0aB4cD7eF1gH5iJ8kL2mN6oP0qR4sT8uV", | ||
| }, | ||
| ExpectedCandidates: []sdk.ImportCandidate{ | ||
| { | ||
| Fields: map[sdk.FieldName]string{ | ||
| fieldname.Token: "kV9wTq3ZtN0aB4cD7eF1gH5iJ8kL2mN6oP0qR4sT8uV", | ||
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Adds a shell plugin for the Netlify CLI. The plugin provisions the
NETLIFY_AUTH_TOKENenvironment variable from 1Password, enabling seamless authentication withoutexposing the personal access token in shell history or dotfiles.
Type of change
Related Issue(s)
How To Test
After installing the plugin, run any Netlify CLI command that requires authentication:
netlify sites:list
1Password will provision
NETLIFY_AUTH_TOKENautomatically before the command runs.Changelog
Authenticate the Netlify CLI using 1Password Shell Plugins with credentials stored securely in your 1Password vault.