Skip to content

Commit 5905e15

Browse files
committed
fix: fix comparison operator and remove unused files for repository variables (#798)
1 parent 317a985 commit 5905e15

File tree

3 files changed

+4
-9
lines changed

3 files changed

+4
-9
lines changed

lib/plugins/variables.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ module.exports = class Variables extends Diffable {
4040
const result =
4141
JSON.stringify(
4242
existing.sort((x1, x2) => {
43-
x1.name.toUpperCase() - x2.name.toUpperCase()
43+
return x1.name.toUpperCase().localeCompare(x2.name.toUpperCase())
4444
})
4545
) !==
4646
JSON.stringify(
4747
variables.sort((x1, x2) => {
48-
x1.name.toUpperCase() - x2.name.toUpperCase()
48+
return x1.name.toUpperCase().localeCompare(x2.name.toUpperCase())
4949
})
5050
)
5151
return result
@@ -154,7 +154,7 @@ module.exports = class Variables extends Diffable {
154154
* @returns
155155
*/
156156
async add (variable) {
157-
this.log.debug(`Adding a repo var with the parms ${JSON.stringify(variable)}`)
157+
this.log.debug(`Adding a repo var with the params ${JSON.stringify(variable)}`)
158158
await this.github
159159
.request('POST /repos/:org/:repo/actions/variables', {
160160
org: this.repo.owner,

test/fixtures/variables-config.yml

Lines changed: 0 additions & 5 deletions
This file was deleted.

test/unit/lib/plugins/variables.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ describe('Variables', () => {
1010
return variables
1111
}
1212

13-
function configure (config) {
13+
function configure () {
1414
const log = { debug: console.debug, error: console.error }
1515
const errors = []
1616
return new Variables(undefined, github, { owner: org, repo }, [{ name: 'test', value: 'test' }], log, errors)

0 commit comments

Comments
 (0)