Skip to content

Commit

Permalink
build: git config before commit
Browse files Browse the repository at this point in the history
currently git commit of the helm charts to
csi-chart repo is failing with below error
```
Author identity unknown

*** Please tell me who you are.

Run

git config --global user.email "you@example.com"
git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.
```
this commit add git config for bot user.

Note:- used ceph.io in github secrets for the bot user
email and its not a valid email id and am also
looking for suggestion if anyone as.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
  • Loading branch information
Madhu-1 authored and nixpanic committed Jun 10, 2021
1 parent 2eebf6b commit 924a5ab
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/publish-artifacts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,14 @@ jobs:
if: github.ref == 'refs/heads/devel'
run: echo "BRANCH_NAME=devel" >> $GITHUB_ENV

- name: Set build environment variables
run: |
echo "GITHUB_USER=${{ secrets.CEPH_CSI_BOT_NAME }}" >> $GITHUB_ENV
echo "GITHUB_EMAIL=${{ secrets.CEPH_CSI_BOT_EMAIL }}" >> $GITHUB_ENV
echo "GITHUB_TOKEN=${{ secrets.CEPH_CSI_BOT_TOKEN }}" >> $GITHUB_ENV
- name: publish artifacts
# podman cannot pull images with both tag and digest
# https://github.com/containers/buildah/issues/1407
# use docker to build images
# yamllint disable-line rule:line-length
run: GITHUB_TOKEN=${{ secrets.CEPH_CSI_BOT_TOKEN }} CONTAINER_CMD=docker ./deploy.sh
run: CONTAINER_CMD=docker ./deploy.sh
4 changes: 4 additions & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ source "$(dirname "${0}")/build.env"

BRANCH_NAME=${BRANCH_NAME:-""}
GITHUB_TOKEN=${GITHUB_TOKEN:-""}
GITHUB_USER=${GITHUB_USER:-"autobuild-bot"}
GITHUB_EMAIL=${GITHUB_EMAIL:-"ceph-csi-bot@users.noreply.github.com"}

# Build and push images. Steps as below:
# 1. get base image from ./build.env (BASE_IMAGE=ceph/ceph:v14.2)
Expand Down Expand Up @@ -82,6 +84,8 @@ push_helm_charts() {

pushd "${CHARTDIR}/csi-charts/docs" >/dev/null
helm repo index .
git config user.name "${GITHUB_USER}"
git config user.email "${GITHUB_EMAIL}"
git add --all :/ && git commit -m "Update for helm charts ${PACKAGE}-${VERSION}"
git push https://"${GITHUB_TOKEN}"@github.com/ceph/csi-charts
popd >/dev/null
Expand Down

0 comments on commit 924a5ab

Please sign in to comment.