From 7e9d9297cd68a80c3fc8d6a027e7941fda3791a3 Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Sun, 31 Dec 2023 11:20:54 +0800 Subject: [PATCH] makes release more normal Signed-off-by: Adrian Cole --- .github/workflows/release.yml | 6 ++++-- build-bin/git/login_git | 24 ++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-) create mode 100755 build-bin/git/login_git diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 44dae40..95282ea 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,6 +14,9 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + with: + # Prevent use of implicit GitHub Actions read-only token GITHUB_TOKEN. + token: ${{ secrets.GH_TOKEN }} - name: Configure Git run: | # Allocate commits to CI, not the owner of the deploy key @@ -30,9 +33,8 @@ jobs: - name: Prepare release run: | - git remote set-url origin https://${{ secrets.GH_TOKEN }}:x-oauth-basic@github.com/$GITHUB_REPOSITORY.git + build-bin/git/login_git && build-bin/helm/helm_prepare $(echo ${GITHUB_REF} | cut -d/ -f 3) ${{ steps.appVersion.outputs.tag }} - git remote set-url origin https://github.com/$GITHUB_REPOSITORY.git - name: Run chart-releaser uses: helm/chart-releaser-action@v1.6.0 diff --git a/build-bin/git/login_git b/build-bin/git/login_git new file mode 100755 index 0000000..111aa09 --- /dev/null +++ b/build-bin/git/login_git @@ -0,0 +1,24 @@ +#!/bin/sh +# +# Copyright 2023 The OpenZipkin Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except +# in compliance with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under the License +# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express +# or implied. See the License for the specific language governing permissions and limitations under +# the License. +# + +set -ue + +# Allocate commits to CI, not the owner of the deploy key +git config user.name "zipkinci" +git config user.email "zipkinci+zipkin-dev@googlegroups.com" + +# Setup https authentication credentials, used by ./mvnw release:prepare +git config credential.helper "store --file=.git/credentials" +echo "https://$GH_TOKEN:@github.com" > .git/credentials