Skip to content

Commit 87a69c7

Browse files
committed
Add extra annotations as columns, allow over ride of hash check
1 parent 57d89ec commit 87a69c7

5 files changed

Lines changed: 32 additions & 2 deletions

File tree

action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ inputs:
1919
push_missing:
2020
description: 'Push services that miss a `catalog-info.yaml` file or not'
2121
required: true
22+
ignore_hash:
23+
description: 'Ignore the hash and update regardless'
24+
default: 'false'
2225
system_database:
2326
description: 'Database ID to read systems from'
2427
owner_database:

dist/index.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21346,6 +21346,18 @@ const mappingFn = {
2134621346
DependsOn: (repo, { dependsOn }) => {
2134721347
return { relation: dependsOn }
2134821348
},
21349+
Environments: (repo) => {
21350+
return {
21351+
multi_select: repo.metadata?.annotations?.environments ? repo.metadata?.annotations?.environments.split(',').flatMap(env => { return { name: env } }) : []
21352+
}
21353+
},
21354+
Deployment: (repo) => {
21355+
return {
21356+
select: {
21357+
name: repo.metadata?.annotations?.deployment || 'Unknown'
21358+
}
21359+
}
21360+
},
2134921361
DependencyOf: null // Skip this field
2135021362
}
2135121363

@@ -21456,7 +21468,8 @@ const createProperties = (repo, pageHash, dependsOn, { systems, owners, structur
2145621468
}
2145721469
})
2145821470

21459-
const doUpdate = newPageHash && newPageHash !== pageHash
21471+
const ignoreHash = core.getInput('ignore_hash') === 'true' // Comes in as string
21472+
const doUpdate = ignoreHash || (newPageHash && newPageHash !== pageHash)
2146021473
properties.Hash = {
2146121474
rich_text: [
2146221475
{

src/local.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ process.env.INPUT_GITHUB_OWNER = 'infinitaslearning'
99
process.env.INPUT_REPOSITORY_FILTER = '.*'
1010
process.env.INPUT_REPOSITORY_BATCH_SIZE = '50'
1111
process.env.INPUT_PUSH_MISSING = 'true'
12+
process.env.INPUT_IGNORE_HASH = 'true'
1213
process.env.INPUT_DATABASE = 'cecaf0beb15945158d155866ff9acce8'
1314
process.env.INPUT_OWNER_DATABASE = '7943615f4dba43b3a3b0f991f4f7136d'
1415
process.env.INPUT_SYSTEM_DATABASE = '121534684fe840a1953500e603c2b602'

src/mappingFn.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,18 @@ const mappingFn = {
122122
DependsOn: (repo, { dependsOn }) => {
123123
return { relation: dependsOn }
124124
},
125+
Environments: (repo) => {
126+
return {
127+
multi_select: repo.metadata?.annotations?.environments ? repo.metadata?.annotations?.environments.split(',').flatMap(env => { return { name: env } }) : []
128+
}
129+
},
130+
Deployment: (repo) => {
131+
return {
132+
select: {
133+
name: repo.metadata?.annotations?.deployment || 'Unknown'
134+
}
135+
}
136+
},
125137
DependencyOf: null // Skip this field
126138
}
127139

src/services.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ const createProperties = (repo, pageHash, dependsOn, { systems, owners, structur
9797
}
9898
})
9999

100-
const doUpdate = newPageHash && newPageHash !== pageHash
100+
const ignoreHash = core.getInput('ignore_hash') === 'true' // Comes in as string
101+
const doUpdate = ignoreHash || (newPageHash && newPageHash !== pageHash)
101102
properties.Hash = {
102103
rich_text: [
103104
{

0 commit comments

Comments
 (0)