Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
S
srvpro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
srvpro
Commits
158f21af
Commit
158f21af
authored
Mar 12, 2018
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update hint
parent
ee5ef8f2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
ygopro-webhook.js
ygopro-webhook.js
+6
-6
No files found.
ygopro-webhook.js
View file @
158f21af
...
...
@@ -112,13 +112,13 @@ var process_callback = function(name, info) {
var
add_process
=
function
(
name
,
info
)
{
if
(
status
[
name
])
{
status
[
name
]
=
2
;
return
"
Another process in
repo
"
+
name
+
"
is running. The process will start after this.
"
;
return
"
Another process in
webhook
"
+
name
+
"
is running. The process will start after this.
"
;
}
status
[
name
]
=
1
;
pull_data
(
info
.
path
,
info
.
remote
,
info
.
branch
,
function
()
{
pull_callback
(
name
,
info
);
});
return
"
Started a process in
repo
"
+
name
+
"
.
"
;
return
"
Started a process in
webhook
"
+
name
+
"
.
"
;
}
//returns
...
...
@@ -152,7 +152,7 @@ http.createServer(function (req, res) {
}
var
hook_info
=
config
.
hooks
[
hook
];
if
(
!
hook_info
)
{
return
return_error
(
res
,
"
Hooked repo
not found.
"
);
return
return_error
(
res
,
"
Webhook
"
+
hook
+
"
not found.
"
);
}
var
info
=
""
;
req
.
addListener
(
'
data
'
,
function
(
chunk
)
{
...
...
@@ -163,17 +163,17 @@ http.createServer(function (req, res) {
try
{
infodata
=
JSON
.
parse
(
info
);
}
catch
(
err
)
{
return
return_error
(
res
,
"
Error parsing JSON:
"
+
err
);
return
return_error
(
res
,
"
Error parsing JSON
in webhook
"
+
hook
+
"
:
"
+
err
);
}
var
ref
=
infodata
.
ref
;
if
(
!
ref
)
{
return
return_success
(
res
,
"
Not a push trigger. Skipped.
"
);
return
return_success
(
res
,
"
Not a push trigger
in webhook
"
+
hook
+
"
. Skipped.
"
);
}
var
branch
=
ref
.
split
(
"
/
"
)[
2
];
if
(
!
branch
)
{
return
return_error
(
res
,
"
Invalid branch.
"
);
}
else
if
(
branch
!==
hook_info
.
branch
)
{
return
return_success
(
res
,
"
Branch
"
+
branch
+
"
in
repo
"
+
hook
+
"
is not the current branch
. Skipped.
"
);
return
return_success
(
res
,
"
Branch
"
+
branch
+
"
in
webhook
"
+
hook
+
"
is not the current branch
"
+
hook_info
.
branch
+
"
. Skipped.
"
);
}
else
{
var
return_msg
=
add_process
(
hook
,
hook_info
);
return
return_success
(
res
,
return_msg
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment