Skip to content

Commit

Permalink
Update release stats workflow (#17580)
Browse files Browse the repository at this point in the history
Follow-up to #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
  • Loading branch information
ijjk authored Oct 5, 2020
1 parent b42be17 commit 100a1d3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/actions/next-stats-action/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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..'
)
Expand Down
4 changes: 3 additions & 1 deletion .github/actions/next-stats-action/src/prepare/action-info.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion release-stats.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 100a1d3

Please sign in to comment.