Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit78d0136

Browse files
authored
Merge pull request#2643 from github/marcogario/robustify_start_proxy_post
Start Proxy: Make the post step more robust to errors
2 parentsc4bbe15 +47dd68e commit78d0136

File tree

4 files changed

+46
-47
lines changed

4 files changed

+46
-47
lines changed

‎lib/start-proxy-action-post.js

Lines changed: 16 additions & 20 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎lib/start-proxy-action-post.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎src/start-proxy-action-post.ts

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -13,40 +13,37 @@ import { getActionsLogger } from "./logging";
1313
import{checkGitHubVersionInRange,getErrorMessage}from"./util";
1414

1515
asyncfunctionrunWrapper(){
16+
constlogger=getActionsLogger();
17+
1618
try{
1719
// Restore inputs from `start-proxy` Action.
1820
actionsUtil.restoreInputs();
21+
22+
// Kill the running proxy
1923
constpid=core.getState("proxy-process-pid");
2024
if(pid){
2125
process.kill(Number(pid));
2226
}
23-
}catch(error){
24-
core.setFailed(
25-
`start-proxy post-action step failed:${getErrorMessage(error)}`,
26-
);
27-
}
28-
constconfig=awaitconfigUtils.getConfig(
29-
actionsUtil.getTemporaryDirectory(),
30-
core,
31-
);
3227

33-
if((config&&config.debugMode)||core.isDebug()){
34-
constlogFilePath=core.getState("proxy-log-file");
35-
core.info(
36-
"Debug mode is on. Uploading proxy log as Actions debugging artifact...",
28+
constconfig=awaitconfigUtils.getConfig(
29+
actionsUtil.getTemporaryDirectory(),
30+
logger,
3731
);
38-
if(config?.gitHubVersion.type===undefined){
39-
core.warning(
40-
`Did not upload debug artifacts because cannot determine the GitHub variant running.`,
41-
);
42-
return;
43-
}
4432

45-
constlogger=getActionsLogger();
46-
constgitHubVersion=awaitgetGitHubVersion();
47-
checkGitHubVersionInRange(gitHubVersion,logger);
33+
if((config&&config.debugMode)||core.isDebug()){
34+
constlogFilePath=core.getState("proxy-log-file");
35+
logger.info(
36+
"Debug mode is on. Uploading proxy log as Actions debugging artifact...",
37+
);
38+
if(config?.gitHubVersion.type===undefined){
39+
logger.warning(
40+
`Did not upload debug artifacts because cannot determine the GitHub variant running.`,
41+
);
42+
return;
43+
}
44+
constgitHubVersion=awaitgetGitHubVersion();
45+
checkGitHubVersionInRange(gitHubVersion,logger);
4846

49-
try{
5047
constartifactUploader=awaitgetArtifactUploaderClient(
5148
logger,
5249
gitHubVersion.type,
@@ -61,10 +58,12 @@ async function runWrapper() {
6158
retentionDays:7,
6259
},
6360
);
64-
}catch(e){
65-
// A failure to upload debug artifacts should not fail the entire action.
66-
core.warning(`Failed to upload debug artifacts:${e}`);
6761
}
62+
}catch(error){
63+
// A failure in the post step should not fail the entire action.
64+
logger.warning(
65+
`start-proxy post-action step failed:${getErrorMessage(error)}`,
66+
);
6867
}
6968
}
7069

‎start-proxy/action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ inputs:
1212
proxy_password:
1313
required:false
1414
description:The password of the proxy
15+
token:
16+
description:GitHub token to use for authenticating with this instance of GitHub, used to upload debug artifacts.
17+
default:${{ github.token }}
18+
required:false
1519
outputs:
1620
proxy_host:
1721
description:The IP address of the proxy

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp