@@ -37,14 +37,14 @@ export default function gitlabCI(url, token) {
3737 }
3838
3939 /**
40- * Set project variable
40+ * Create project variable
4141 *
4242 * @param key
4343 * @param value
4444 *
4545 * @return {Promise<Object> } variable object
4646 */
47- async function setVariable ( key , value ) {
47+ async function createVariable ( key , value ) {
4848 const response = await axios ( {
4949 method : 'post' ,
5050 url : `${ apiUrl } ?${ tokenQueryString } ` ,
@@ -107,7 +107,7 @@ export default function gitlabCI(url, token) {
107107
108108 const promises = keysToSet . map ( async ( key ) => {
109109 const value = properties [ key ] ;
110- const keyExists = existingKeys . some ( existingKey => existingKey === key ) ;
110+ const keyExists = existingKeys . includes ( key ) ;
111111
112112 if ( keyExists && ! forceUpdate ) {
113113 console . log ( `Skipping ${ key } , already set for ${ projectId } .` ) ;
@@ -120,7 +120,7 @@ export default function gitlabCI(url, token) {
120120 variable = await updateVariable ( key , value ) ;
121121 } else {
122122 // Create variable
123- variable = await setVariable ( key , value ) ;
123+ variable = await createVariable ( key , value ) ;
124124 }
125125
126126 console . log ( `Set ${ key } = ${ JSON . stringify ( value ) } for ${ projectId } ` ) ;
@@ -133,7 +133,7 @@ export default function gitlabCI(url, token) {
133133 }
134134
135135 return {
136- setVariable ,
136+ createVariable ,
137137 updateVariable,
138138 listVariables,
139139 setVariables,
0 commit comments