@@ -34310,7 +34310,7 @@ async function main() {
3431034310 if (!process.env.GITHUB_TOKEN) {
3431134311 core.setFailed(
3431234312 `GITHUB_TOKEN is not configured. Make sure you made it available to your action
34313-
34313+
3431434314 uses: gr2m/create-or-update-pull-request-action@master
3431534315 env:
3431634316 GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}`
@@ -34331,10 +34331,6 @@ async function main() {
3433134331 return;
3433234332 }
3433334333
34334- const octokit = new Octokit({
34335- auth: process.env.GITHUB_TOKEN,
34336- });
34337-
3433834334 const [owner, repo] = process.env.GITHUB_REPOSITORY.split("/");
3433934335
3434034336 try {
@@ -34366,15 +34362,6 @@ async function main() {
3436634362 process.exit(1);
3436734363 }
3436834364
34369- const {
34370- data: { default_branch },
34371- } = await octokit.request(`GET /repos/{owner}/{repo}`, {
34372- owner,
34373- repo,
34374- });
34375- const DEFAULT_BRANCH = default_branch;
34376- core.debug(`DEFAULT_BRANCH: ${DEFAULT_BRANCH}`);
34377-
3437834365 const { hasChanges } = await getLocalChanges(inputs.path);
3437934366
3438034367 if (!hasChanges) {
@@ -34425,6 +34412,19 @@ async function main() {
3442534412 `git rev-parse --abbrev-ref HEAD`
3442634413 );
3442734414
34415+ const octokit = new Octokit({
34416+ auth: process.env.GITHUB_TOKEN,
34417+ });
34418+
34419+ const {
34420+ data: { default_branch },
34421+ } = await octokit.request(`GET /repos/{owner}/{repo}`, {
34422+ owner,
34423+ repo,
34424+ });
34425+ const DEFAULT_BRANCH = default_branch;
34426+ core.debug(`DEFAULT_BRANCH: ${DEFAULT_BRANCH}`);
34427+
3442834428 if (currentBranch === DEFAULT_BRANCH) {
3442934429 core.info(`Already in base branch "${currentBranch}".`);
3443034430 } else {
0 commit comments