diff --git a/.github/workflows/bump_release.yml b/.github/workflows/bump_release.yml index ada5f1a..d3c44b7 100644 --- a/.github/workflows/bump_release.yml +++ b/.github/workflows/bump_release.yml @@ -28,6 +28,7 @@ jobs: uses: actions/checkout@v3 with: fetch-depth: 0 + persist-credentials: false - name: Setup Node.js uses: actions/setup-node@v3 diff --git a/.github/workflows/make_release.yml b/.github/workflows/make_release.yml index 6eb9379..314c182 100644 --- a/.github/workflows/make_release.yml +++ b/.github/workflows/make_release.yml @@ -47,13 +47,13 @@ jobs: run: | git pull semantic-release --dry-run --no-ci - NEXT_VERSION=$(grep -Po 'Version:([ ]*)?(.*)' "style.css" | tr -s ' ' | cut -d' ' -f2) + export NEXT_VERSION=$(grep -Po 'Version:([ ]*)?(.*)' "style.css" | tr -s ' ' | cut -d' ' -f2) git checkout -b "release-${NEXT_VERSION}" - sed -i "s/Version: .*/Version: release-${NEXT_VERSION}/" style.css git add style.css - NEED_COMMIT=$(git diff --name-status --cached --exit-code 1>/dev/null; echo $?;) - if [[ $NEED_COMMIT == 1 ]] - then - git commit -m "ci(develop): preparing release branch release-${NEXT_VERSION}" - fi - git push origin release-${NEXT_VERSION} + git commit -m "ci(develop): preparing release branch release-${NEXT_VERSION}" || true + + - name: Git push changes + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.PERSONAL_GITHUB_TOKEN }} + branch: release-${NEXT_VERSION} diff --git a/.github/workflows/publish_release.yml b/.github/workflows/publish_release.yml index 2273f9b..6b83c55 100644 --- a/.github/workflows/publish_release.yml +++ b/.github/workflows/publish_release.yml @@ -41,21 +41,20 @@ jobs: git config user.name "github-ci-bot" - name: Merging release + env: + GITHUB_TOKEN: ${{ secrets.PERSONAL_GITHUB_TOKEN }} run: | git fetch git rev-parse --verify ${{ inputs.targetBranch }} && git branch -D ${{ inputs.targetBranch }} git checkout --force --track origin/${{ inputs.targetBranch }} git reset --hard origin/${{ inputs.targetBranch }} git merge --no-ff --no-edit --no-commit origin/${{ github.ref_name }} - NEED_COMMIT=$(git diff --name-status --cached --exit-code 1>/dev/null; echo $?;) - if [[ $NEED_COMMIT == 1 ]] - then - git commit -m "ci(${{ github.ref_name }}): merging prepared release" - git push origin ${{ inputs.targetBranch }} - else - echo "> no changes to be commited on ${{ inputs.targetBranch }}" - echo "> no new release to bump" - fi - # delete release branch - git branch -D ${{ github.ref_name }} + git commit -m "ci(${{ github.ref_name }}): merging prepared release" \ + || echo "> no changes to be commited on ${{ inputs.targetBranch }} - no new release to bump" git push --delete origin ${{ github.ref_name }} + + - name: Git push changes + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.PERSONAL_GITHUB_TOKEN }} + branch: ${{ inputs.targetBranch }}