File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 201201 "light" : " resources/icons/light/remove.svg"
202202 }
203203 },
204+ {
205+ "command" : " github-actions.settings.variable.copy-name" ,
206+ "category" : " GitHub Actions" ,
207+ "title" : " Copy variable name"
208+ },
209+ {
210+ "command" : " github-actions.settings.variable.copy-value" ,
211+ "category" : " GitHub Actions" ,
212+ "title" : " Copy variable value"
213+ },
204214 {
205215 "command" : " github-actions.workflow.pin" ,
206216 "category" : " GitHub Actions" ,
348358 "group" : " inline@2" ,
349359 "when" : " viewItem == 'repo-variable' || viewItem == 'env-variable'"
350360 },
361+ {
362+ "command" : " github-actions.settings.variable.copy-name" ,
363+ "when" : " viewItem == 'repo-variable' || viewItem == 'env-variable'" ,
364+ "group" : " context"
365+ },
366+ {
367+ "command" : " github-actions.settings.variable.copy-value" ,
368+ "when" : " viewItem == 'repo-variable' || viewItem == 'env-variable'" ,
369+ "group" : " context"
370+ },
351371 {
352372 "command" : " github-actions.workflow.run.open" ,
353373 "when" : " viewItem =~ /run\\ s/" ,
Original file line number Diff line number Diff line change 1+ import * as vscode from "vscode" ;
2+ import { VariableCommandArgs } from "../../treeViews/settings/variableNode" ;
3+
4+ export function registerCopyVariable ( context : vscode . ExtensionContext ) {
5+ context . subscriptions . push (
6+ vscode . commands . registerCommand ( "github-actions.settings.variable.copy-name" , async ( args : VariableCommandArgs ) => {
7+ const { variable} = args ;
8+
9+ await vscode . env . clipboard . writeText ( variable . name ) ;
10+
11+ vscode . window . setStatusBarMessage ( `Copied ${ variable . name } ` , 2000 ) ;
12+ } ) ,
13+ vscode . commands . registerCommand (
14+ "github-actions.settings.variable.copy-value" ,
15+ async ( args : VariableCommandArgs ) => {
16+ const { variable} = args ;
17+
18+ await vscode . env . clipboard . writeText ( variable . value ) ;
19+
20+ vscode . window . setStatusBarMessage ( `Copied ${ variable . value } ` , 2000 ) ;
21+ }
22+ )
23+ ) ;
24+ }
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import {registerUpdateSecret} from "./commands/secrets/updateSecret";
1515import { registerTriggerWorkflowRun } from "./commands/triggerWorkflowRun" ;
1616import { registerUnPinWorkflow } from "./commands/unpinWorkflow" ;
1717import { registerAddVariable } from "./commands/variables/addVariable" ;
18+ import { registerCopyVariable } from "./commands/variables/copyVariable" ;
1819import { registerDeleteVariable } from "./commands/variables/deleteVariable" ;
1920import { registerUpdateVariable } from "./commands/variables/updateVariable" ;
2021import { initConfiguration } from "./configuration/configuration" ;
@@ -68,6 +69,7 @@ export async function activate(context: vscode.ExtensionContext) {
6869 registerAddVariable ( context ) ;
6970 registerUpdateVariable ( context ) ;
7071 registerDeleteVariable ( context ) ;
72+ registerCopyVariable ( context ) ;
7173
7274 registerPinWorkflow ( context ) ;
7375 registerUnPinWorkflow ( context ) ;
You can’t perform that action at this time.
0 commit comments