Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 49 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 21 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
"activationEvents": [
"onView:workflows",
"onView:settings",
"onDebugResolve:github-actions-job",
"onCommand:github-actions.debugger.connect",
"workspaceContains:**/.github/workflows/**",
"workspaceContains:**/action.yml",
"workspaceContains:**/action.yaml"
Expand Down Expand Up @@ -97,7 +99,19 @@
}
}
},
"debuggers": [
{
"type": "github-actions-job",
"label": "GitHub Actions Job Debugger",
"languages": []
}
],
"commands": [
{
"command": "github-actions.debugger.connect",
"category": "GitHub Actions",
"title": "Debug Running Job…"
},
{
"command": "github-actions.explorer.refresh",
"category": "GitHub Actions",
Expand Down Expand Up @@ -521,6 +535,10 @@
{
"command": "github-actions.sign-in",
"when": "false"
},
{
"command": "github-actions.debugger.connect",
"when": "config.github-actions.debugger.enabled && !isWeb"
}
]
}
Expand All @@ -544,6 +562,7 @@
"@types/libsodium-wrappers": "^0.7.10",
"@types/uuid": "^3.4.6",
"@types/vscode": "^1.72.0",
"@types/ws": "^8.18.1",
"@typescript-eslint/eslint-plugin": "^5.40.0",
"@typescript-eslint/parser": "^5.40.0",
"@vscode/test-web": "^0.0.69",
Expand Down Expand Up @@ -579,7 +598,8 @@
"tunnel": "0.0.6",
"util": "^0.12.1",
"uuid": "^3.3.3",
"vscode-languageclient": "^8.0.2"
"vscode-languageclient": "^8.0.2",
"ws": "^8.20.0"
},
"overrides": {
"browserify-sign": {
Expand Down
48 changes: 47 additions & 1 deletion src/configuration/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,19 @@ import {resetGitHubContext} from "../git/repository";

const settingsKey = "github-actions";
const DEFAULT_GITHUB_API = "https://api.github.com";
const reloadWindowAction = "Reload Window";
const debuggerEnabledSettingsKey = getSettingsKey("debugger.enabled");

let debuggerSettingReloadPromptVisible = false;

export function initConfiguration(context: vscode.ExtensionContext) {
context.subscriptions.push(
vscode.workspace.onDidChangeConfiguration(async e => {
if (e.affectsConfiguration(getSettingsKey("workflows.pinned"))) {
pinnedWorkflowsChangeHandlers.forEach(h => h());
} else if (
}

if (
e.affectsConfiguration(getSettingsKey("use-enterprise")) ||
(useEnterprise() &&
(e.affectsConfiguration("github-enterprise.uri") || e.affectsConfiguration(getSettingsKey("remote-name"))))
Expand All @@ -19,6 +25,10 @@ export function initConfiguration(context: vscode.ExtensionContext) {
resetGitHubContext();
await vscode.commands.executeCommand("github-actions.explorer.refresh");
}

if (e.affectsConfiguration(debuggerEnabledSettingsKey)) {
await promptToReloadForDebuggerSettingChange(context);
}
})
);
}
Expand Down Expand Up @@ -64,6 +74,10 @@ export function getRemoteName(): string {
return getConfiguration().get<string>(getSettingsKey("remote-name"), "origin");
}

export function isDebuggerEnabled(): boolean {
return getConfiguration().get<boolean>(debuggerEnabledSettingsKey, false);
}

export function useEnterprise(): boolean {
return getConfiguration().get<boolean>(getSettingsKey("use-enterprise"), false);
}
Expand All @@ -87,3 +101,35 @@ async function updateLanguageServerApiUrl(context: vscode.ExtensionContext) {

await initLanguageServer(context);
}

async function promptToReloadForDebuggerSettingChange(context: vscode.ExtensionContext) {
if (vscode.env.uiKind !== vscode.UIKind.Desktop) {
return;
}

if (debuggerSettingReloadPromptVisible) {
return;
}

debuggerSettingReloadPromptVisible = true;

try {
if (context.extensionMode !== vscode.ExtensionMode.Production) {
await vscode.window.showInformationMessage(
"Reload VS Code manually to apply the GitHub Actions debugger preview setting change. Automatic reload is disabled in the Extension Development Host."
);
return;
}

const selection = await vscode.window.showInformationMessage(
"Reload VS Code to apply the GitHub Actions debugger preview setting change.",
reloadWindowAction
);

if (selection === reloadWindowAction) {
await vscode.commands.executeCommand("workbench.action.reloadWindow");
}
} finally {
debuggerSettingReloadPromptVisible = false;
}
}
Loading
Loading