Skip to content

Commit

Permalink
refactor: improve logs (#21)
Browse files Browse the repository at this point in the history
Improve console logs and add a plugin for major semantic releases.
  • Loading branch information
Balvajs authored Aug 6, 2023
1 parent 9cff0a3 commit d82e854
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 8 deletions.
3 changes: 2 additions & 1 deletion .releaserc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
["@semantic-release/git", {
"assets": ["dist/**", "action.yml", "package.json"],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}]
}],
"semantic-release-major-tag"
]
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
contents: write # to be able to delete branches
pull-requests: read # to be able to confirm that branches don't have associated PRs
steps:
- uses: balvajs/delete-stale-branches
- uses: balvajs/delete-stale-branches@v1
with:
days-to-delete: 120
dry-run: false
Expand Down
6 changes: 3 additions & 3 deletions dist/main.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/main.cjs.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"node-fetch": "3.3.2",
"prettier": "3.0.1",
"semantic-release": "^21.0.7",
"semantic-release-major-tag": "0.3.2",
"ts-jest": "29.1.1",
"ts-node": "10.9.1",
"tsup": "7.2.0",
Expand Down
6 changes: 4 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ async function run(): Promise<void> {
console.log(
`\n\nDeleting ${branchesToDelete.length} ${pluralizeBranches(
branchesToDelete.length,
)} that are inactive for more than ${daysToDelete} days...\n`,
)} that ${
branchesToDelete.length === 1 ? 'is' : 'are'
} inactive for more than ${daysToDelete} days...`,
)

const deletionResults = await Promise.allSettled(
Expand Down Expand Up @@ -98,7 +100,7 @@ async function run(): Promise<void> {
}

console.log(
`Successfully deleted ${branchesToDelete.length} ${pluralizeBranches(
`\nSuccessfully deleted ${branchesToDelete.length} ${pluralizeBranches(
branchesToDelete.length,
)}.`,
)
Expand Down
8 changes: 8 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4910,6 +4910,7 @@ __metadata:
node-fetch: 3.3.2
prettier: 3.0.1
semantic-release: ^21.0.7
semantic-release-major-tag: 0.3.2
ts-jest: 29.1.1
ts-node: 10.9.1
tsup: 7.2.0
Expand Down Expand Up @@ -10638,6 +10639,13 @@ __metadata:
languageName: node
linkType: hard

"semantic-release-major-tag@npm:0.3.2":
version: 0.3.2
resolution: "semantic-release-major-tag@npm:0.3.2"
checksum: 253af6f8434b26505717b921ce8f525143c4b015293793c28b4159c66279d2d075c7461cb6880f7345b525937229b3c5c923f4c0113927503fa096d94fb548e3
languageName: node
linkType: hard

"semantic-release@npm:^21.0.7":
version: 21.0.7
resolution: "semantic-release@npm:21.0.7"
Expand Down

0 comments on commit d82e854

Please sign in to comment.