Skip to content

Commit

Permalink
add Octokit
Browse files Browse the repository at this point in the history
  • Loading branch information
mokimo committed May 8, 2024
1 parent 6299854 commit 555fc37
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/merge-to-stage.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const SLACK = {
`:fast_forward: Created <${html_url}|Stage to Main PR ${number}>`,
};

let github, owner, repo, currPrNumber, core;
let github, owner, repo, currPrNumber, core, getOctokit;

let body = `
## common base root URLs
Expand Down Expand Up @@ -135,7 +135,7 @@ const merge = async ({ prs }) => {
}
files.forEach((file) => (SEEN[file] = true));
if (!process.env.LOCAL_RUN) {
const octokit = github.getOctokit(process.env.MILO_GITHUB_TOKEN);
const octokit = getOctokit(process.env.MILO_GITHUB_TOKEN);
await octokit.rest.pulls.merge({
owner,
repo,
Expand Down Expand Up @@ -225,6 +225,7 @@ const main = async (params) => {
repo = params.context.repo.repo;
currPrNumber = params.context.issue?.number;
core = params.core;
getOctokit = params.getOctokit;

const now = new Date();
// We need to revisit this every year
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/merge-to-stage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ jobs:
uses: actions/github-script@v7.0.1
with:
script: |
const {getOctokit} = require('@actions/github')
const main = require('./.github/workflows/merge-to-stage.js')
main({ github, context, core })
main({ github, context, core, getOctokit })
env:
MILO_GITHUB_TOKEN: ${{ steps.milo-pr-merge-token.outputs.token }}

0 comments on commit 555fc37

Please sign in to comment.