Skip to content

Commit

Permalink
Push commits via API in github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
vgarciabnz committed Nov 13, 2024
1 parent fa7bd8e commit 62533d0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 31 deletions.
13 changes: 3 additions & 10 deletions .github/workflows/release-generate-notes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 "<[email protected]>"
- name: Commit changes
run: |
# Commit and push
git commit -am "Update release notes"
git push
uses: flex-development/[email protected]
with:
message: "Update release notes"
30 changes: 9 additions & 21 deletions .github/workflows/release-start.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,24 +33,18 @@ 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 "<[email protected]>"
# override vName with new version
- name: Create release branch
run: git checkout -b release/${{ inputs.release_version_name }}

- 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/[email protected]
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
Expand All @@ -65,23 +59,17 @@ 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 "<[email protected]>"
- name: Create release branch
run: git checkout -b update_version_to${{ inputs.development_version_name }}

- name: Run Python script to update base branch version
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/[email protected]
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'
Expand Down

0 comments on commit 62533d0

Please sign in to comment.