Skip to content

Commit

Permalink
Remove _master binary usage (#208)
Browse files Browse the repository at this point in the history
* remove usage of master binary

* resolve merge conflict

* lint fix

---------

Co-authored-by: Gulom Alimov <[email protected]>
  • Loading branch information
Googlom and Gulom Alimov authored Aug 15, 2024
1 parent 0e89613 commit eab2f71
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 28 deletions.
2 changes: 1 addition & 1 deletion dist/index.js

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

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ async function getPiperBinaryNameFromInputs (isEnterpriseStep: boolean, version?
piper = 'sap-piper'
}
if (version === 'master') {
piper += '_master'
info('using _master binaries is deprecated. Using latest release version instead.')
}
return piper
}
Expand Down
25 changes: 0 additions & 25 deletions test/github.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,31 +90,6 @@ describe('GitHub package tests', () => {
expect(core.info).toHaveBeenCalledTimes(1)
})

test('downloadPiperBinary - OS step, master', async () => {
const assetUrl = `${githubApiURL}/release/assets/123456`
jest.spyOn(octokit, 'Octokit').mockImplementationOnce(() => {
return {
request: async () => {
return {
data: {
tag_name: version,
assets: [{ name: 'piper_master', url: assetUrl }]
},
status: 200
}
}
} as unknown as octokit.Octokit
})

await downloadPiperBinary(osStep, 'master', githubApiURL, token, owner, repo)
expect(core.debug).toHaveBeenNthCalledWith(1, 'Fetching binary from GitHub API')
expect(core.debug).toHaveBeenNthCalledWith(2, `Fetching release info from ${githubApiURL}/repos/${owner}/${repo}/releases/latest`)
expect(core.debug).toHaveBeenNthCalledWith(5, `Found asset URL: ${assetUrl} and tag: ${version}`)
expect(core.debug).toHaveBeenCalledTimes(5)
expect(core.info).toHaveBeenNthCalledWith(1, expect.stringContaining(`Downloading '${assetUrl}' as '${process.cwd()}/${version.replace(/\./g, '_')}/piper_master'`))
expect(core.info).toHaveBeenCalledTimes(1)
})

test('downloadPiperBinary - OS step, exact version', async () => {
const assetUrl = `${githubApiURL}/release/assets/123456`
jest.spyOn(octokit, 'Octokit').mockImplementationOnce(() => {
Expand Down

0 comments on commit eab2f71

Please sign in to comment.