diff --git a/README.md b/README.md
index e4888ae..3ba42cd 100644
--- a/README.md
+++ b/README.md
@@ -27,17 +27,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- # Perform a minimal checkout to set up this repository for the rest of the
- # workflow.
- #
- # This step must be configured exactly as below: using different
- # actions/checkout arguments is not supported.
- - name: Checkout this repository
- uses: actions/checkout@v4
- with:
- filter: tree:0
-
- # Run the estimation tool
- name: Run sizeup
# TODO: Replace the version below with your desired version.
uses: lerebear/sizeup-action@v0.4.2
diff --git a/badges/coverage.svg b/badges/coverage.svg
index d179b1d..24cd63a 100644
--- a/badges/coverage.svg
+++ b/badges/coverage.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/dist/index.js b/dist/index.js
index 8cef7fe..d372d6d 100644
--- a/dist/index.js
+++ b/dist/index.js
@@ -16402,27 +16402,17 @@ exports.pullRequestAuthorHasNotOptedIn = pullRequestAuthorHasNotOptedIn;
*/
async function fetchDiff(pull) {
const git = (0, simple_git_1.simpleGit)('.', { trimmed: true });
- // let baseRefExists = false
- // try {
- // baseRefExists = !!(await git.raw('rev-parse', '--verify', pull.base.ref))
- // } catch (e) {
- // core.error(
- // `Error from 'git rev-parse --verfy ${pull.base.ref}': ${
- // (e as Error).message
- // }`
- // )
- // }
- // if (!baseRefExists) {
- // core.setFailed(
- // `Could not find pull request base branch ${pull.base.ref}. ` +
- // `Please make sure actions/checkout was used beforehand to fetch ${pull.base.ref}.`
- // )
- // return
- // }
- core.debug(`Fetching base ref "${pull.base.ref}" and head ref "${pull.head.ref}"`);
+ core.debug(`Cloning just the base ref "${pull.base.ref}"`);
+ const cloneUrl = `https://${core.getInput('token')}@github.com/${github.context.repo.owner}/${github.context.repo.repo}`;
+ await git.clone(cloneUrl, '.', [
+ `--branch=${pull.base.ref}`,
+ '--filter=tree:0',
+ '--no-tags',
+ '--single-branch'
+ ]);
+ core.debug(`Fetching head ref "${pull.head.ref}"`);
await git.fetch([
'origin',
- `+${pull.base.ref}:${pull.base.ref}`,
`+${pull.head.ref}:${pull.head.ref}`,
`--filter=tree:0`,
'--no-tags',
diff --git a/src/initializer.ts b/src/initializer.ts
index c4eb934..5880cb6 100644
--- a/src/initializer.ts
+++ b/src/initializer.ts
@@ -72,32 +72,20 @@ export async function fetchDiff(
): Promise {
const git = simpleGit('.', { trimmed: true })
- // let baseRefExists = false
- // try {
- // baseRefExists = !!(await git.raw('rev-parse', '--verify', pull.base.ref))
- // } catch (e) {
- // core.error(
- // `Error from 'git rev-parse --verfy ${pull.base.ref}': ${
- // (e as Error).message
- // }`
- // )
- // }
-
- // if (!baseRefExists) {
- // core.setFailed(
- // `Could not find pull request base branch ${pull.base.ref}. ` +
- // `Please make sure actions/checkout was used beforehand to fetch ${pull.base.ref}.`
- // )
- // return
- // }
-
- core.debug(
- `Fetching base ref "${pull.base.ref}" and head ref "${pull.head.ref}"`
- )
+ core.debug(`Cloning just the base ref "${pull.base.ref}"`)
+ const cloneUrl = `https://${core.getInput('token')}@github.com/${
+ github.context.repo.owner
+ }/${github.context.repo.repo}`
+ await git.clone(cloneUrl, '.', [
+ `--branch=${pull.base.ref}`,
+ '--filter=tree:0',
+ '--no-tags',
+ '--single-branch'
+ ])
+ core.debug(`Fetching head ref "${pull.head.ref}"`)
await git.fetch([
'origin',
- `+${pull.base.ref}:${pull.base.ref}`,
`+${pull.head.ref}:${pull.head.ref}`,
`--filter=tree:0`,
'--no-tags',