Add information action
Signed-off-by: Sanjula Ganepola <sanjulagane@gmail.com>
This commit is contained in:
15
package.json
15
package.json
@@ -66,6 +66,12 @@
|
||||
"title": "Refresh",
|
||||
"icon": "$(refresh)"
|
||||
},
|
||||
{
|
||||
"category": "GitHub Local Actions",
|
||||
"command": "githubLocalActions.information",
|
||||
"title": "Information",
|
||||
"icon": "$(info)"
|
||||
},
|
||||
{
|
||||
"category": "GitHub Local Actions",
|
||||
"command": "githubLocalActions.runAllWorkflows",
|
||||
@@ -109,6 +115,10 @@
|
||||
"command": "githubLocalActions.refreshComponents",
|
||||
"when": "never"
|
||||
},
|
||||
{
|
||||
"command": "githubLocalActions.information",
|
||||
"when": "never"
|
||||
},
|
||||
{
|
||||
"command": "githubLocalActions.runAllWorkflows",
|
||||
"when": "never"
|
||||
@@ -162,6 +172,11 @@
|
||||
}
|
||||
],
|
||||
"view/item/context": [
|
||||
{
|
||||
"command": "githubLocalActions.information",
|
||||
"when": "view == components && viewItem =~ /^githubLocalActions.component.*/",
|
||||
"group": "inline@0"
|
||||
},
|
||||
{
|
||||
"command": "githubLocalActions.openWorkflow",
|
||||
"when": "view == workflows && viewItem =~ /^githubLocalActions.workflow.*/",
|
||||
|
||||
@@ -6,6 +6,7 @@ export interface Component<T extends CliStatus | ExtensionStatus> {
|
||||
icon: string,
|
||||
version?: string,
|
||||
status: T,
|
||||
information: string,
|
||||
required: boolean
|
||||
message?: string
|
||||
}
|
||||
@@ -30,6 +31,7 @@ export class ComponentManager {
|
||||
icon: 'terminal',
|
||||
version: actCliInfo.version,
|
||||
status: actCliInfo.status,
|
||||
information: 'https://github.com/nektos/act',
|
||||
required: true
|
||||
});
|
||||
|
||||
@@ -41,6 +43,7 @@ export class ComponentManager {
|
||||
icon: 'dashboard',
|
||||
version: dockerEngineVersion,
|
||||
status: dockerEngineStatus,
|
||||
information: 'https://docs.docker.com/engine',
|
||||
required: true
|
||||
});
|
||||
|
||||
@@ -50,6 +53,7 @@ export class ComponentManager {
|
||||
icon: 'extensions',
|
||||
version: githubActionsInfo.version,
|
||||
status: githubActionsInfo.status,
|
||||
information: 'https://marketplace.visualstudio.com/items?itemName=GitHub.vscode-github-actions',
|
||||
required: false,
|
||||
message: 'GitHub Actions extension is not required, but is recommended to take advantage of workflow editor features.'
|
||||
});
|
||||
@@ -60,6 +64,7 @@ export class ComponentManager {
|
||||
icon: 'terminal',
|
||||
version: githubCliInfo.version,
|
||||
status: githubCliInfo.status,
|
||||
information: 'https://cli.github.com',
|
||||
required: false,
|
||||
message: 'GitHub CLI is not required, but is recommended if you plan to use it to retrieve GitHub tokens.'
|
||||
});
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { CancellationToken, commands, EventEmitter, ExtensionContext, extensions, TreeDataProvider, TreeItem } from "vscode";
|
||||
import { CancellationToken, commands, env, EventEmitter, ExtensionContext, extensions, TreeDataProvider, TreeItem, Uri } from "vscode";
|
||||
import { ComponentManager } from "../../componentManager";
|
||||
import { GithubLocalActionsTreeItem } from "../githubLocalActionsTreeItem";
|
||||
import ComponentTreeItem from "./component";
|
||||
@@ -16,6 +16,9 @@ export default class ComponentsTreeDataProvider implements TreeDataProvider<Gith
|
||||
context.subscriptions.push(
|
||||
commands.registerCommand('githubLocalActions.refreshComponents', async () => {
|
||||
this.refresh();
|
||||
}),
|
||||
commands.registerCommand('githubLocalActions.information', async (componentTreeItem: ComponentTreeItem) => {
|
||||
env.openExternal(Uri.parse(componentTreeItem.component.information));
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user