Commit e8b55c51 authored by Regis's avatar Regis

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

parent 715461a9
......@@ -55,16 +55,13 @@
return ({ name: ref.name, tag: ref['tag?'], ref_url: ref.url });
},
commitTitle(pipeline) {
if (pipeline.commit) return pipeline.commit.title;
return '';
return pipeline.commit ? pipeline.commit.title : '';
},
commitSha(pipeline) {
if (pipeline.commit) return pipeline.commit.short_id;
return '';
return pipeline.commit ? pipeline.commit.short_id : '';
},
commitUrl(pipeline) {
if (pipeline.commit) return pipeline.commit.commit_url;
return '';
return pipeline.commit ? pipeline.commit.commit_url : '';
},
match(string) {
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