Skip to content

Commit

Permalink
Bump version to 2.30.0
Browse files Browse the repository at this point in the history
  • Loading branch information
shivammathur committed Mar 1, 2024
1 parent 4f6ab99 commit a4e22b6
Show file tree
Hide file tree
Showing 5 changed files with 275 additions and 280 deletions.
4 changes: 2 additions & 2 deletions __tests__/tools.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ describe('Tools tests', () => {
${'beta_token'} | ${'1.2.3-beta1'}
${''} | ${'1.2.3'}
`('checking getSemverVersion: $token', async ({token, version}) => {
process.env['COMPOSER_TOKEN'] = token;
process.env['GITHUB_TOKEN'] = token;
expect(
await tools.getSemverVersion(getData({tool: 'tool', version: '1.2'}))
).toBe(version);
Expand Down Expand Up @@ -574,7 +574,7 @@ describe('Tools tests', () => {
${'phpunit:1.2'} | ${'invalid_token'} | ${'add_log "$cross" "phpunit" "Invalid token"'}
${'phpunit:0.1'} | ${'no_data'} | ${'add_log "$cross" "phpunit" "No version found with prefix 0.1."'}
`('checking error: $tools_csv', async ({tools_csv, token, script}) => {
process.env['COMPOSER_TOKEN'] = token;
process.env['GITHUB_TOKEN'] = token;
expect(await tools.addTools(tools_csv, '7.4', 'linux')).toContain(script);
});

Expand Down
7 changes: 2 additions & 5 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -693,11 +693,8 @@ const utils = __importStar(__nccwpck_require__(918));
async function getSemverVersion(data) {
const search = data['version_prefix'] + data['version'];
const url = `https://api.github.com/repos/${data['repository']}/git/matching-refs/tags%2F${search}.`;
let github_token = await utils.readEnv('GITHUB_TOKEN');
const composer_token = await utils.readEnv('COMPOSER_TOKEN');
if (composer_token && !github_token) {
github_token = composer_token;
}
const github_token = (await utils.readEnv('GITHUB_TOKEN')) ||
(await utils.readEnv('COMPOSER_TOKEN'));
const response = await fetch.fetch(url, github_token);
if (response.error || response.data === '[]') {
data['error'] = response.error ?? `No version found with prefix ${search}.`;
Expand Down
Loading

0 comments on commit a4e22b6

Please sign in to comment.