Skip to content

Commit

Permalink
docs: correct ref link in perf test resport
Browse files Browse the repository at this point in the history
  • Loading branch information
SkReD committed Nov 14, 2022
1 parent f1e4430 commit 000c441
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/pvm-core/lib/git/rev-parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default function revParse(ref: string, cwd: string): string {
if (headContent) {
// symref
if (headContent.startsWith('ref: ')) {
return fs.readFileSync(path.join(cwd, '.git', headContent.split('ref: ')[1]), 'utf-8')
return fs.readFileSync(path.join(cwd, '.git', headContent.split('ref: ')[1]), 'utf-8').trim()
// plain commit sha
} else {
return headContent
Expand Down
4 changes: 3 additions & 1 deletion scripts/perf/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@ ${versions.map(p => p.split('/')[1]).join('\n')}`)
}
}

const ref = process.env.GITHUB_REF_TYPE === 'branch' ? process.env.GITHUB_SHA : process.env.GITHUB_REF_NAME
const refUrlPath = process.env.GITHUB_REF_TYPE === 'branch' ? '/commit/' : '/releases/tag/'
const result = {
releaseLink: `<a href="${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}/releases/tag/${process.env.GITHUB_REF_NAME}">${process.env.GITHUB_REF_NAME}</a>`,
releaseLink: `<a href="${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}${refUrlPath}${ref}">${ref}</a>`,
timestamp: new Date().toUTCString(),
packagesCount: PACKAGES_COUNT,
releasesCount: RELEASES_COUNT,
Expand Down

0 comments on commit 000c441

Please sign in to comment.