Skip to content

Commit

Permalink
fix: introduce test mode
Browse files Browse the repository at this point in the history
  • Loading branch information
DaRaFF committed Oct 19, 2021
1 parent ccaf4de commit ddebb8d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ npx github:livingdocsIO/release-notes-patch \
--tag=v75.15.5
```

```bash
# no commit - updated release-notes go to stdout
npx github:DaRaFF/release-notes-patch \
...
--test=true
```

## via CI (drone)

```bash
Expand Down
5 changes: 4 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const targetBasePath = 'content/operations/releases'


// main application
module.exports = async ({token, owner, repo, sha, tag} = {}) => {
module.exports = async ({token, owner, repo, sha, tag, test = false} = {}) => {
const release = await getReleaseByCommit({owner, repo, sha, token, branches})
if (!release) {
return `commit ${sha} not found in ${owner}/${repo} in the white listed release branches \n\r${branches.join('\n\r')}`
Expand Down Expand Up @@ -64,6 +64,9 @@ module.exports = async ({token, owner, repo, sha, tag} = {}) => {

const patchedBase64ReleaseNotes = Buffer.from(patchedReleaseNotes).toString('base64')

// in test mode, show new relase-notes in console
if (test) return patchedReleaseNotes

await updateContent({
owner: targetOwner,
repo: targetRepo,
Expand Down

0 comments on commit ddebb8d

Please sign in to comment.