From 62533d0a08d00d3e79d683d468b265b6482bae92 Mon Sep 17 00:00:00 2001 From: Victor Garcia Date: Wed, 13 Nov 2024 12:32:58 +0100 Subject: [PATCH] Push commits via API in github actions --- .github/workflows/release-generate-notes.yml | 13 ++------- .github/workflows/release-start.yml | 30 ++++++-------------- 2 files changed, 12 insertions(+), 31 deletions(-) diff --git a/.github/workflows/release-generate-notes.yml b/.github/workflows/release-generate-notes.yml index 81c112255b..c4c2217ad4 100644 --- a/.github/workflows/release-generate-notes.yml +++ b/.github/workflows/release-generate-notes.yml @@ -27,14 +27,7 @@ jobs: working-directory: ./scripts run: python3 generateReleaseNotes.py - - name: setup git config - run: | - # setup the username and email. - git config user.name "GitHub Actions Bot" - git config user.email "" - - name: Commit changes - run: | - # Commit and push - git commit -am "Update release notes" - git push + uses: flex-development/gh-commit@1.0.0 + with: + message: "Update release notes" diff --git a/.github/workflows/release-start.yml b/.github/workflows/release-start.yml index 538e250e51..edf9194b4a 100644 --- a/.github/workflows/release-start.yml +++ b/.github/workflows/release-start.yml @@ -33,12 +33,6 @@ jobs: with: python-version: 3.12.1 - - name: setup git config - run: | - # setup the username and email. - git config user.name "GitHub Actions Bot" - git config user.email "" - # override vName with new version - name: Create release branch run: git checkout -b release/${{ inputs.release_version_name }} @@ -46,11 +40,11 @@ jobs: - name: Run Python script to update release branch version run: python scripts/updateVersionName.py ${{ inputs.release_version_name }} - - name: Push - run: | - git add . - git commit -m "Update version to ${{ inputs.release_version_name }}" - git push origin release/${{ inputs.release_version_name }} + - name: Commit and Push Changes + uses: flex-development/gh-commit@1.0.0 + with: + message: 'Update version to ${{ inputs.release_version_name }}' + ref: 'release/${{ inputs.release_version_name }}' update_version: # The type of runner that the job will run on @@ -65,12 +59,6 @@ jobs: with: python-version: 3.12.1 - - name: setup git config - run: | - # setup the username and email. - git config user.name "GitHub Actions Bot" - git config user.email "" - - name: Create release branch run: git checkout -b update_version_to${{ inputs.development_version_name }} @@ -78,10 +66,10 @@ jobs: run: python scripts/updateVersionName.py ${{ inputs.development_version_name }} - name: Commit and Push Changes - run: | - git add . - git commit -m "Update version to ${{ inputs.development_version_name }}" - git push origin update_version_to${{ inputs.development_version_name }} + uses: flex-development/gh-commit@1.0.0 + with: + message: 'Update version to ${{ inputs.development_version_name }}' + ref: 'update_version_to${{ inputs.development_version_name }}' - name: create pull request run: gh pr create -B develop -H update_version_to${{ inputs.development_version_name }} --title 'Merge update_version_to${{ inputs.development_version_name }} into develop' --body 'Created by Github action'