Skip to content

Commit

Permalink
fix: Use jq to ensure we read isDeprecated better, and defend depreca…
Browse files Browse the repository at this point in the history
…tion filter more
  • Loading branch information
mutahhir committed Jan 9, 2024
1 parent 73e9fa6 commit ae54ab3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/deprecate-packages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,14 @@ export class DeprecatePackages {
name: "Check deprecation status",
id: "check_status",
run: [
`IS_DEPRECATED=$(npm pkg get cdktf.isDeprecated | tr -d '"')`,
`IS_DEPRECATED=$(cat package.json | jq .cdktf.isDeprecated -r)`,
`echo "is_deprecated=$IS_DEPRECATED"`, // for easier debugging
`echo "is_deprecated=$IS_DEPRECATED" >> $GITHUB_OUTPUT`,
].join("\n"),
},
{
name: "Deprecate the package on NPM",
if: "steps.check_status.outputs.is_deprecated",
if: "steps.check_status.outputs.is_deprecated == 'true' || steps.check_status.outputs.is_deprecated == true",
run: [
'npm set "//$NPM_REGISTRY/:_authToken=$NPM_TOKEN"',
`npm deprecate ${packageInfo.npm.name} "${deprecationMessageForNPM}"`,
Expand Down

0 comments on commit ae54ab3

Please sign in to comment.