未验证 提交 f27e1f85 编写于 作者: J JJ Kasper 提交者: GitHub

Update release stats workflow (#17533)

Co-authored-by: Nkodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
上级 10f7b8f9
const path = require('path')
const fs = require('fs-extra')
const exec = require('./util/exec') const exec = require('./util/exec')
const logger = require('./util/logger') const logger = require('./util/logger')
const runConfigs = require('./run') const runConfigs = require('./run')
...@@ -25,6 +27,13 @@ if (!allowedActions.has(actionInfo.actionName) && !actionInfo.isRelease) { ...@@ -25,6 +27,13 @@ if (!allowedActions.has(actionInfo.actionName) && !actionInfo.isRelease) {
;(async () => { ;(async () => {
try { try {
if (await fs.pathExists(path.join(process.cwd(), 'SKIP_NEXT_STATS.txt'))) {
console.log(
'SKIP_NEXT_STATS.txt file present, exiting stats generation..'
)
process.exit(0)
}
const { stdout: gitName } = await exec( const { stdout: gitName } = await exec(
'git config user.name && git config user.email' 'git config user.name && git config user.email'
) )
......
...@@ -184,3 +184,14 @@ jobs: ...@@ -184,3 +184,14 @@ jobs:
key: ${{ github.sha }} key: ${{ github.sha }}
- run: ./publish-release.sh - run: ./publish-release.sh
prStats:
name: Release Stats
runs-on: ubuntu-latest
needs: [publishRelease]
steps:
- uses: actions/checkout@v2
- run: ./release-stats.sh
- uses: ./.github/actions/next-stats-action
env:
PR_STATS_COMMENT_TOKEN: ${{ secrets.PR_STATS_COMMENT_TOKEN }}
on: release
name: Generate Release Stats
jobs:
prStats:
name: Release Stats
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/next-stats-action
env:
PR_STATS_COMMENT_TOKEN: ${{ secrets.PR_STATS_COMMENT_TOKEN }}
#!/bin/bash
git describe --exact-match
if [[ ! $? -eq 0 ]];then
echo "Nothing to publish, exiting.."
touch SKIP_NEXT_STATS.txt
exit 0;
fi
if [[ -z "$NPM_TOKEN" ]];then
echo "No NPM_TOKEN, exiting.."
exit 0;
fi
echo "Publish occurred, running release stats..."
echo "Waiting 30 seconds to allow publish to finalize"
sleep 30
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册