[github-actions] checkout@v2 allows simpler branch name extraction

This commit is contained in:
Ronny Wegener 2020-01-18 10:50:25 +01:00
parent ebceb2f864
commit 67b15105bb
1 changed files with 1 additions and 6 deletions

View File

@ -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 {`,