From 54da42600e5086b89016e8f04a8851aca088c34d Mon Sep 17 00:00:00 2001 From: Donald Wasserman Date: Sun, 26 Jan 2020 21:27:13 -0500 Subject: [PATCH] Tweak some settings to test why things are failing on this repo --- .github/workflows/changelog.yml | 1 + dist/index.js | 8 +++----- index.js | 8 +++----- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index 3273bd6..f42e0f4 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -12,3 +12,4 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} # Required changelog: 'CHANGELOG.md' # optional, default: CHANGELOG.md + use_pullrequest: true diff --git a/dist/index.js b/dist/index.js index 2993487..a69d52d 100644 --- a/dist/index.js +++ b/dist/index.js @@ -504,8 +504,7 @@ async function run() { usePr = core.getInput('use_pullrequest'), defaultBranch = core.getInput('default_branch'), ownerRepo = process.env.GITHUB_REPOSITORY, - eventPath = process.env.GITHUB_EVENT_PATH, - eventName = process.env.GITHUB_EVENT_NAME; + eventPath = process.env.GITHUB_EVENT_PATH; const [owner, repo] = ownerRepo.split('/'); @@ -532,7 +531,7 @@ async function run() { sha = data.sha; } let contentBuffer = Buffer.from(data.content, 'base64'); - currentContents = `${contentBuffer.toString('utf8')} ${NEWLINE}`; + currentContents = `${contentBuffer.toString('utf8')}`; } catch (e) { changelogExists = false; } @@ -541,8 +540,7 @@ async function run() { let branch = defaultBranch || releaseBranch; - let newContents = - `### [${name}](${url}) ${NEWLINE} **${tag}** ${NEWLINE} ${body}` + currentContents; + let newContents = `### [${name}](${url}) ${NEWLINE} **${tag}** ${NEWLINE} ${body} ${NEWLINE} ${currentContents}`; let buff = new Buffer.from(newContents); let content = buff.toString('base64'); diff --git a/index.js b/index.js index c3d1b21..5063dfa 100644 --- a/index.js +++ b/index.js @@ -10,8 +10,7 @@ async function run() { usePr = core.getInput('use_pullrequest'), defaultBranch = core.getInput('default_branch'), ownerRepo = process.env.GITHUB_REPOSITORY, - eventPath = process.env.GITHUB_EVENT_PATH, - eventName = process.env.GITHUB_EVENT_NAME; + eventPath = process.env.GITHUB_EVENT_PATH; const [owner, repo] = ownerRepo.split('/'); @@ -38,7 +37,7 @@ async function run() { sha = data.sha; } let contentBuffer = Buffer.from(data.content, 'base64'); - currentContents = `${contentBuffer.toString('utf8')} ${NEWLINE}`; + currentContents = `${contentBuffer.toString('utf8')}`; } catch (e) { changelogExists = false; } @@ -47,8 +46,7 @@ async function run() { let branch = defaultBranch || releaseBranch; - let newContents = - `### [${name}](${url}) ${NEWLINE} **${tag}** ${NEWLINE} ${body}` + currentContents; + let newContents = `### [${name}](${url}) ${NEWLINE} **${tag}** ${NEWLINE} ${body} ${NEWLINE} ${currentContents}`; let buff = new Buffer.from(newContents); let content = buff.toString('base64');