mirror of
https://github.com/discordjs/discord-api-types.git
synced 2026-06-03 01:10:09 +00:00
fix(CI): skip pull request checks for runs that don't include the token (#327)
This commit is contained in:
@@ -4,9 +4,6 @@ import conventionalRecommendedBump from 'conventional-recommended-bump';
|
||||
import { execSync } from 'node:child_process';
|
||||
import { promisify } from 'node:util';
|
||||
|
||||
const octokit = new Octokit();
|
||||
const [OWNER, REPOSITORY] = process.env.GITHUB_REPOSITORY.split('/');
|
||||
|
||||
const lastCommitMessage = execSync('git log -1 --pretty=%B', { encoding: 'utf8' });
|
||||
|
||||
if (lastCommitMessage.startsWith('chore(release)')) {
|
||||
@@ -45,6 +42,14 @@ console.info(
|
||||
`✅ Done! discord-api-types was bumped to ${newVersion['discord-api-types']}! Checking if there was a pull request open already and closing it if so...`,
|
||||
);
|
||||
|
||||
if (!process.env.GITHUB_TOKEN) {
|
||||
console.info('🙉 Skipping the pull request checks as no GITHUB_TOKEN was provided.');
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
const octokit = new Octokit();
|
||||
const [OWNER, REPOSITORY] = process.env.GITHUB_REPOSITORY.split('/');
|
||||
|
||||
const pullRequests = await octokit.pulls.list({
|
||||
owner: OWNER,
|
||||
repo: REPOSITORY,
|
||||
|
||||
Reference in New Issue
Block a user