Skip to content

Commit 496e210

Browse files
committed
fix: ⚡ do not commit unecesseraly
1 parent 23dbca4 commit 496e210

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@cpn-console/observability-plugin",
33
"type": "module",
4-
"version": "1.0.0",
4+
"version": "1.0.1",
55
"description": "Loki plugin for DSO console",
66
"exports": {
77
".": {

src/yaml.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,13 @@ export async function upsertGitlabConfig(project: Project, gitlabApi: GitlabInte
121121
const yamlFile = await readYamlFile<YamlLokiData>(Buffer.from(file, 'utf-8').toString('utf-8'))
122122

123123
const projects = yamlFile.global?.projects || {}
124+
125+
if (JSON.stringify(projects[project.id]) === JSON.stringify(projectValue)) {
126+
return 'Already up-to-date'
127+
}
128+
124129
projects[project.id] = projectValue
130+
125131
const yamlString = writeYamlFile({
126132
...yamlFile,
127133
global: {

0 commit comments

Comments
 (0)