Skip to content

Commit

Permalink
fix: Merge branch syncing PRs with Apify Service Account [internal]
Browse files Browse the repository at this point in the history
  • Loading branch information
fnesveda committed Apr 15, 2024
1 parent 6d4477f commit 65d56cd
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/sync_branches.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ jobs:
script: |
const { Octokit } = require('@octokit/rest');
// Create a new Octokit instance under Apify Service Account
// Apify Service Account does not trigger PR toolkit,
// does not need approval for PRs and does not need to wait for status checks
const octokit = new Octokit({
auth: process.env.GIT_HUB_TOKEN,
});
Expand All @@ -60,9 +63,7 @@ jobs:
throw new Error(`Don't know how to handle event name: ${eventName}`);
}
// Create pull request as Apify Service Account
// Apify Service Account does not trigger PR toolkit,
// does not need approval for PRs and does not need to wait for status checks
// Create pull request from headBranch to baseBranch (typically `master` to `develop`)
const createResp = await octokit.rest.pulls.create({
owner: context.repo.owner,
repo: context.repo.repo,
Expand All @@ -74,7 +75,7 @@ jobs:
const pullRequestNumber = createResp.data.number;
// Merge pull request
await github.rest.pulls.merge({
await octokit.rest.pulls.merge({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: pullRequestNumber,
Expand Down

0 comments on commit 65d56cd

Please sign in to comment.