From 61028b6cf18d40e122bb0fa25b23dbc37c10e856 Mon Sep 17 00:00:00 2001 From: Telan <13066272+TheElan@users.noreply.github.com> Date: Fri, 12 Nov 2021 19:57:50 +0200 Subject: [PATCH] ci: configure git in separate step; specify current branch when pushing new builscript version --- .github/scripts/update-version.sh | 6 +----- .github/workflows/repository-specific.yml | 4 ++++ build.gradle | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/scripts/update-version.sh b/.github/scripts/update-version.sh index 5158684..cd60431 100755 --- a/.github/scripts/update-version.sh +++ b/.github/scripts/update-version.sh @@ -1,13 +1,9 @@ if [ ! -z $(git diff --name-only HEAD HEAD~1 | grep build.gradle) ]; then new_version="$(git log -n1 --format=format:"%H")" sed --in-place "s!//version:.*!//version: $new_version!g" build.gradle - - git config user.email "johann.bernhardt@tum.de" - git config user.name "Github CI Worker" - git add build.gradle git commit -m "[ci skip] update build script version to $new_version" - git push + git push origin ${GITHUB_REF##*/} echo "Updated buildscript version to $new_version"; else echo "Ignored buildscript version update: no changes detected" diff --git a/.github/workflows/repository-specific.yml b/.github/workflows/repository-specific.yml index 958eceb..0780ad2 100644 --- a/.github/workflows/repository-specific.yml +++ b/.github/workflows/repository-specific.yml @@ -16,6 +16,10 @@ jobs: uses: actions/checkout@v2 with: fetch-depth: 2 + - name: setup git config + run: | + git config user.name "GitHub CI Bot" + git config user.email "<>" - name: Ensure build script version is up to date run: .github/scripts/update-version.sh diff --git a/build.gradle b/build.gradle index 696fda4..715ee07 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ -//version: commit hash placeholder; dummy changes to test automatic version update +//version: commit hash placeholder /* DO NOT CHANGE THIS FILE!