From debb939543184a8a0d60974307267035d223cf41 Mon Sep 17 00:00:00 2001 From: Armin Broubakarian Date: Sun, 10 Nov 2024 23:02:42 -0600 Subject: [PATCH] fix: update dist --- .github/workflows/repo-pruner.yml | 2 +- README.md | 2 +- dist/index.js | 8 +++++++- src/index.ts | 3 +++ 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/repo-pruner.yml b/.github/workflows/repo-pruner.yml index 490dbfb..89c7193 100644 --- a/.github/workflows/repo-pruner.yml +++ b/.github/workflows/repo-pruner.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Run Repo Pruner - uses: arminbro/repo-pruner@v1.0.2 + uses: arminbro/repo-pruner@v1.0.3 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: diff --git a/README.md b/README.md index 2969d52..eb3d6ce 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Run Repo Pruner - uses: arminbro/repo-pruner@v1.0.2 + uses: arminbro/repo-pruner@v1.0.3 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: diff --git a/dist/index.js b/dist/index.js index 9be5d81..ccd6480 100644 --- a/dist/index.js +++ b/dist/index.js @@ -29940,8 +29940,12 @@ const core = __importStar(__nccwpck_require__(7484)); const github = __importStar(__nccwpck_require__(3228)); async function run() { try { + // Get token + const token = process.env.GITHUB_TOKEN; + if (!token) { + throw new Error(`GITHUB_TOKEN environment variable is not set`); + } // Get input values - const token = core.getInput('repo-token', { required: true }); const inactiveDays = parseInt(core.getInput('inactive_days') || '30'); const baseBranch = core.getInput('base_branch') || 'main'; const octokit = github.getOctokit(token); @@ -29983,6 +29987,8 @@ async function run() { if (!lastCommitDate) { throw new Error(`Branch ${branch.name} is missing the last commit date.`); } + console.log('lastCommitDate', lastCommitDate); + console.log('thresholdDate', thresholdDate); if (lastCommitDate < thresholdDate) { // Branch is inactive const branchName = branch.name; diff --git a/src/index.ts b/src/index.ts index ab74097..280038a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -62,6 +62,9 @@ async function run() { throw new Error(`Branch ${branch.name} is missing the last commit date.`); } + console.log('lastCommitDate', lastCommitDate); + console.log('thresholdDate', thresholdDate); + if (lastCommitDate < thresholdDate) { // Branch is inactive const branchName = branch.name;