From 0da6b76e2dcb5e59f1dd915e47fb01b98b8df563 Mon Sep 17 00:00:00 2001 From: Rui Baltazar Date: Fri, 17 Jul 2020 13:16:54 +0800 Subject: [PATCH] [#98] new approach --- .github/workflows/changelog.yml | 42 ++++++++++++++++++++------------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index c23e4ea3..ecf5c1bf 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -33,23 +33,31 @@ jobs: git config --local user.name "$ACTION_USERNAME" git add CHANGELOG.md && git commit -m 'Updated CHANGELOG.md' && echo ::set-env name=push::1 || echo "No changes to CHANGELOG.md" - - name: Push changelog to master - if: env.push == 1 - uses: ad-m/github-push-action@master - with: - github_token: ${{ secrets.CHANGELOG_GITHUB_TOKEN }} - branch: master - - - name: Cherry-pick changelog to development + - name: Push changes if: env.push == 1 env: - ACTION_EMAIL: action@github.com - ACTION_USERNAME: GitHub Action + # CI_USER: ${{ secrets.YOUR_GITHUB_USER }} + CI_TOKEN: ${{ secrets.CHANGELOG_GITHUB_TOKEN }} run: | - git config --local user.email "$ACTION_EMAIL" - git config --local user.name "$ACTION_USERNAME" - commit_hash=`git show HEAD | egrep commit\ .+$ | cut -d' ' -f2` - git checkout development - git pull - git cherry-pick $commit_hash - git push + git push "https://$GITHUB_ACTOR:$CI_TOKEN@github.com/$GITHUB_REPOSITORY.git" HEAD:master + + # - name: Push changelog to master + # if: env.push == 1 + # uses: ad-m/github-push-action@master + # with: + # github_token: ${{ secrets.CHANGELOG_GITHUB_TOKEN }} + # branch: master + + # - name: Cherry-pick changelog to development + # if: env.push == 1 + # env: + # ACTION_EMAIL: action@github.com + # ACTION_USERNAME: GitHub Action + # run: | + # git config --local user.email "$ACTION_EMAIL" + # git config --local user.name "$ACTION_USERNAME" + # commit_hash=`git show HEAD | egrep commit\ .+$ | cut -d' ' -f2` + # git checkout development + # git pull + # git cherry-pick $commit_hash + # git push