Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/funny-files-roll.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@scaleway/changesets-renovate': patch
---

Create a new commit instead of amend + force push
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,8 @@ describe('generate changeset file', () => {
expect(fs.readFile).toHaveBeenCalledWith(file, 'utf8')
expect(fs.writeFile).toMatchSnapshot()
expect(add).toHaveBeenCalledWith(fileName)
expect(commit).toHaveBeenCalledWith([], undefined, {
'-C': null,
HEAD: null,
'--amend': null,
'--no-edit': null,
})
expect(push).toHaveBeenCalledWith(['--force'])
expect(commit).toHaveBeenCalledWith(`Add changeset renovate-${rev}`)
expect(push).toHaveBeenCalledTimes(1)
})

it('should ignore workspace package.json', async () => {
Expand Down
13 changes: 4 additions & 9 deletions packages/changesets-renovate/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,19 +98,14 @@ export async function run() {
return
}

const shortHash = await simpleGit().revparse(['--short', 'HEAD'])
const fileName = `.changeset/renovate-${shortHash.trim()}.md`
const shortHash = (await simpleGit().revparse(['--short', 'HEAD'])).trim()
const fileName = `.changeset/renovate-${shortHash}.md`
const packageBumps = await getBumps(files)

await createChangeset(fileName, packageBumps, packageNames)
await simpleGit().add(fileName)
await simpleGit().commit([], undefined, {
'-C': null,
HEAD: null,
'--amend': null,
'--no-edit': null,
})
await simpleGit().push(['--force'])
await simpleGit().commit(`Add changeset renovate-${shortHash}`)
await simpleGit().push()
}

run().catch(console.error)