From 2babe49c642ff19b6cdfaf7699892723cbb5fb2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9r=C3=A8?= Date: Wed, 24 Jul 2024 14:11:48 -0700 Subject: [PATCH] Configure sizeup-action on this repo --- .github/workflows/sizeup.yaml | 22 ++++++++++++++++++++++ dist/index.js | 9 +++++---- package-lock.json | 8 ++++---- package.json | 2 +- 4 files changed, 32 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/sizeup.yaml diff --git a/.github/workflows/sizeup.yaml b/.github/workflows/sizeup.yaml new file mode 100644 index 0000000..05df43b --- /dev/null +++ b/.github/workflows/sizeup.yaml @@ -0,0 +1,22 @@ +name: SizeUp + +on: pull_request + +permissions: + contents: read + issues: write + pull-requests: write + +jobs: + sizeup: + name: Estimate reviewability + runs-on: ubuntu-latest + + steps: + - name: Estimate pull request reviewability + uses: lerebear/sizeup-action@v0.8.2 + id: sizeup-action + with: + token: "${{ secrets.GITHUB_TOKEN }}" + # Uncomment line below to use custom sizeup-action configuration. + # configuration-file-path: ".github/workflows/sizeup/config.yaml" diff --git a/dist/index.js b/dist/index.js index eda3186..f7ab163 100644 --- a/dist/index.js +++ b/dist/index.js @@ -92444,6 +92444,7 @@ class Git { constructor(token, baseDirectory = '.') { const basicCredential = Buffer.from(`x-access-token:${token}`, 'utf8').toString('base64'); const authorizationHeader = `AUTHORIZATION: basic ${basicCredential}`; + this.baseDirectory = baseDirectory; this.client = (0, simple_git_1.simpleGit)(baseDirectory, { trimmed: true, config: [`http.extraheader=${authorizationHeader}`] @@ -92458,8 +92459,8 @@ class Git { * required for efficiency. * @param targetDirectory The directory in which to clone the repository. */ - async clone(repo, headRef, targetDirectory = '.') { - await this.client.clone(`https://github.com/${repo}`, targetDirectory, [ + async clone(repo, headRef) { + await this.client.clone(`https://github.com/${repo}`, this.baseDirectory, [ `--branch=${headRef}`, '--filter=tree:0', '--no-tags', @@ -93013,8 +93014,8 @@ class SizeUp { diff = diffOrRemote; } else { - const git = new git_1.Git(diffOrRemote.token); - await git.clone(diffOrRemote.repo, diffOrRemote.headRef, diffOrRemote.cloneDirectory); + const git = new git_1.Git(diffOrRemote.token, diffOrRemote.cloneDirectory); + await git.clone(diffOrRemote.repo, diffOrRemote.headRef); diff = await git.diff(diffOrRemote.baseRef, diffOrRemote.diffOptions || []); } return new context_1.Context({ diff --git a/package-lock.json b/package-lock.json index 2e22820..c4c7c77 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,7 +14,7 @@ "@actions/github": "^5.1.1", "@octokit/webhooks": "^12.0.3", "simple-git": "^3.21.0", - "sizeup-core": "^0.5.1", + "sizeup-core": "^0.5.2", "yaml": "^2.3.2" }, "devDependencies": { @@ -7876,9 +7876,9 @@ "dev": true }, "node_modules/sizeup-core": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/sizeup-core/-/sizeup-core-0.5.1.tgz", - "integrity": "sha512-d6ee0oyIlzlsKgtPsvlUmWWYluvcz6VfjFrk1C9X3j0admol3BODzkr46fFinLQlB4Lux0jwz/7ufEaPiiuqKA==", + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/sizeup-core/-/sizeup-core-0.5.2.tgz", + "integrity": "sha512-MjBW3YeiRSdHQbsNi+eZVLkix7gG+IR4HBVBNj1i7zOXFuERn2vphynMPcRdHIPvo8MKhp0d5ygwIJsB5J9u8w==", "dependencies": { "minimatch": "^9.0.3", "parse-diff": "^0.11.1", diff --git a/package.json b/package.json index 643d0ad..f30b9ae 100644 --- a/package.json +++ b/package.json @@ -70,7 +70,7 @@ "@actions/github": "^5.1.1", "@octokit/webhooks": "^12.0.3", "simple-git": "^3.21.0", - "sizeup-core": "^0.5.1", + "sizeup-core": "^0.5.2", "yaml": "^2.3.2" }, "devDependencies": {