Skip to content

Commit bda79bd

Browse files
Archival Mode (#95)
* added archival option * changed workflow to archive * reverting archive option * testing null status key * added back archive to a null status field * reverting workflow file * reverting code.json * reverting version * fixed syntax * added tags logic
1 parent 2e2f8f7 commit bda79bd

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

action.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ inputs:
2121
description: "Personal Access Token with admin/write privileges for direct push. Required when SKIP_PR is true."
2222
required: false
2323

24+
ARCHIVE:
25+
description: "Option to set this tool to archive mode which prepares a repository for archival."
26+
required: false
27+
default: "false"
28+
2429
outputs:
2530
updated:
2631
description: "Boolean indicating whether code.json was updated"

src/main.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,19 @@ async function getMetaData(
121121
}
122122
}
123123

124+
// handling archive option
125+
const isArchived = core.getInput("ARCHIVE", { required: false }) === "true";
126+
let status: string = existingCodeJSON?.status || ""
127+
128+
if (isArchived) {
129+
status = "Archival";
130+
tags?.push("Archived");
131+
}
132+
124133
return {
125134
name: partialCodeJSON.name,
126135
description: description,
136+
status: status,
127137
repositoryURL: partialCodeJSON.repositoryURL,
128138
repositoryVisibility: partialCodeJSON.repositoryVisibility,
129139
laborHours: partialCodeJSON.laborHours,

0 commit comments

Comments
 (0)