[github-actions] checkout@v2 allows simpler branch name extraction
This commit is contained in:
parent
ebceb2f864
commit
67b15105bb
|
@ -64,12 +64,7 @@ async function polymerBuild(settings) {
|
|||
}
|
||||
|
||||
async function createVersionInfo(file) {
|
||||
let branch = undefined;
|
||||
// GitHub actions checkout the commit in a detached HEAD state => try to get branch from GitHub environment variable
|
||||
if(process.env.GITHUB_REF) {
|
||||
process.env.GITHUB_REF.split('/').pop();
|
||||
}
|
||||
branch = branch || (await execute(`git rev-parse --abbrev-ref HEAD`)).trim();
|
||||
let branch = /*process.env.GITHUB_REF ? process.env.GITHUB_REF.split('/').pop() : */(await execute(`git rev-parse --abbrev-ref HEAD`)).trim();
|
||||
let revision = (await execute(`git rev-parse HEAD`)).trim();
|
||||
let content = [
|
||||
`export default {`,
|
||||
|
|
Loading…
Reference in New Issue