Skip to content

Commit 656ef22

Browse files
devversionjelbourn
authored andcommitted
chore: setup git before publishing the builds (#2197)
* It looks like Git is unable to push the changes right now, because they don't have any commiter name & email set
1 parent b850fed commit 656ef22

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

scripts/release/publish-build-artifacts.sh

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ buildDir="dist/@angular/material"
1010
buildVersion=$(sed -nE 's/^\s*"version": "(.*?)",$/\1/p' package.json)
1111

1212
commitSha=$(git rev-parse --short HEAD)
13-
commitAuthor=$(git --no-pager show -s --format='%an <%ae>' HEAD)
13+
commitAuthorName=$(git --no-pager show -s --format='%an' HEAD)
14+
commitAuthorEmail=$(git --no-pager show -s --format='%ae' HEAD)
1415
commitMessage=$(git log --oneline | head -n1)
1516

1617
repoName="material-builds"
@@ -32,15 +33,18 @@ rm -rf $repoDir/*
3233
cp -r $buildDir/* $repoDir
3334

3435
# Create the build commit and push the changes to the repository.
35-
cd $repoDir &&
36+
cd $repoDir
37+
38+
# Prepare Git for pushing the artifacts to the repository.
39+
git config user.name "$commitAuthorName"
40+
git config user.email "$commitAuthorEmail"
41+
git config credential.helper "store --file=.git/credentials"
3642

37-
# Setup the git repository authentication.
38-
git config credential.helper "store --file=.git/credentials" &&
3943
echo "$MATERIAL2_BUILDS_TOKEN" > .git/credentials
4044

41-
git add -A &&
42-
git commit -m "$commitMessage" --author "$commitAuthor" &&
43-
git tag "$buildVersion-$commitSha" &&
45+
git add -A
46+
git commit -m "$commitMessage"
47+
git tag "$buildVersion-$commitSha"
4448
git push origin master --tags
4549

4650
echo "Finished publishing build artifacts"

0 commit comments

Comments
 (0)