From 100a1d3acc3de6242dc1e3034d1cb8905b8f6d0b Mon Sep 17 00:00:00 2001 From: JJ Kasper Date: Mon, 5 Oct 2020 04:32:12 -0500 Subject: [PATCH] Update release stats workflow (#17580) Follow-up to https://github.com/vercel/next.js/pull/17533 this makes sure the file used to signal release stats should be skipped for a non-release merge is created in a location that is accessible by the stats action and also updates the release action info detection for the new workflow --- .github/actions/next-stats-action/src/index.js | 2 +- .github/actions/next-stats-action/src/prepare/action-info.js | 4 +++- release-stats.sh | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/actions/next-stats-action/src/index.js b/.github/actions/next-stats-action/src/index.js index d7332d5edc89..f24fe427faf8 100644 --- a/.github/actions/next-stats-action/src/index.js +++ b/.github/actions/next-stats-action/src/index.js @@ -27,7 +27,7 @@ if (!allowedActions.has(actionInfo.actionName) && !actionInfo.isRelease) { ;(async () => { try { - if (await fs.pathExists(path.join(process.cwd(), 'SKIP_NEXT_STATS.txt'))) { + if (await fs.pathExists(path.join(__dirname, '../SKIP_NEXT_STATS.txt'))) { console.log( 'SKIP_NEXT_STATS.txt file present, exiting stats generation..' ) diff --git a/.github/actions/next-stats-action/src/prepare/action-info.js b/.github/actions/next-stats-action/src/prepare/action-info.js index 427fee1fd774..fff1ffc955cb 100644 --- a/.github/actions/next-stats-action/src/prepare/action-info.js +++ b/.github/actions/next-stats-action/src/prepare/action-info.js @@ -56,7 +56,9 @@ module.exports = function actionInfo() { isLocal: LOCAL_STATS, commitId: null, issueId: ISSUE_ID, - isRelease: releaseTypes.has(GITHUB_ACTION), + isRelease: + GITHUB_REPOSITORY === 'vercel/next.js' && + (GITHUB_REF || '').includes('canary'), } // get comment diff --git a/release-stats.sh b/release-stats.sh index 406d1620f084..975aaf96ebb5 100755 --- a/release-stats.sh +++ b/release-stats.sh @@ -4,7 +4,7 @@ git describe --exact-match if [[ ! $? -eq 0 ]];then echo "Nothing to publish, exiting.." - touch SKIP_NEXT_STATS.txt + touch .github/actions/next-stats-action/SKIP_NEXT_STATS.txt exit 0; fi