Commit e8b55c51 authored by Regis's avatar Regis

refactor commitSha - commitUrl - commitTitle in pipelines.js.es6

parent 715461a9
...@@ -55,16 +55,13 @@ ...@@ -55,16 +55,13 @@
return ({ name: ref.name, tag: ref['tag?'], ref_url: ref.url }); return ({ name: ref.name, tag: ref['tag?'], ref_url: ref.url });
}, },
commitTitle(pipeline) { commitTitle(pipeline) {
if (pipeline.commit) return pipeline.commit.title; return pipeline.commit ? pipeline.commit.title : '';
return '';
}, },
commitSha(pipeline) { commitSha(pipeline) {
if (pipeline.commit) return pipeline.commit.short_id; return pipeline.commit ? pipeline.commit.short_id : '';
return '';
}, },
commitUrl(pipeline) { commitUrl(pipeline) {
if (pipeline.commit) return pipeline.commit.commit_url; return pipeline.commit ? pipeline.commit.commit_url : '';
return '';
}, },
match(string) { match(string) {
return string.replace(/_([a-z])/g, (m, w) => w.toUpperCase()); return string.replace(/_([a-z])/g, (m, w) => w.toUpperCase());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment