From 80896e6dd70b28bc60e5dd3e8c75aa69fd715fb7 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Thu, 13 Jan 2022 07:08:44 -0800 Subject: [PATCH] build: fix workflow access to git history Refs: https://github.com/nodejs/node/pull/41466 PR-URL: https://github.com/nodejs/node/pull/41472 Reviewed-By: Richard Lau Reviewed-By: Tierney Cyren --- .github/workflows/find-inactive-tsc.yml | 1 + tools/find-inactive-tsc.mjs | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/find-inactive-tsc.yml b/.github/workflows/find-inactive-tsc.yml index aacb4d1ed56de5..5d834c8cb25d70 100644 --- a/.github/workflows/find-inactive-tsc.yml +++ b/.github/workflows/find-inactive-tsc.yml @@ -19,6 +19,7 @@ jobs: - name: Checkout the repo uses: actions/checkout@v2 with: + fetch-depth: 0 persist-credentials: false - name: Clone nodejs/TSC repository diff --git a/tools/find-inactive-tsc.mjs b/tools/find-inactive-tsc.mjs index acd2cee45b6fb6..362e2ee293922c 100755 --- a/tools/find-inactive-tsc.mjs +++ b/tools/find-inactive-tsc.mjs @@ -211,7 +211,8 @@ async function moveTscToEmeritus(peopleToMove) { // only been on the TSC for a week and therefore hasn't attended any meetings. const tscMembersAtEnd = await getTscFromReadme(); -await runGitCommand(`git checkout 'HEAD@{${SINCE}}' -- README.md`); +const startCommit = await runGitCommand(`git rev-list -1 --before '${SINCE}' HEAD`); +await runGitCommand(`git checkout ${startCommit} -- README.md`); const tscMembersAtStart = await getTscFromReadme(); await runGitCommand('git reset HEAD README.md'); await runGitCommand('git checkout -- README.md');