Skip to content

Commit

Permalink
add new action
Browse files Browse the repository at this point in the history
  • Loading branch information
qrazhan committed Sep 3, 2024
1 parent a3b5623 commit 354c822
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 1 deletion.
55 changes: 55 additions & 0 deletions .github/workflows/prashan_version_bump.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: prashan testing new action
on:
pull_request_target:
types: [opened, synchronize, reopened]

permissions:
contents: write

jobs:
update_version:
runs-on: macos-latest
steps:
- name: checkout
uses: actions/checkout@v4
with:
# Fetch full depth, otherwise the last step overwrites the last commit's parent, essentially removing the graph.
fetch-depth: 0
token: ${{ secrets.BOT_PAT }}
ref: ${{ github.head_ref }}

- name: Run bump_version_gh_action.sh
id: bump-version
run: |
set +e
./bump_version_gh_action.sh
echo "bump_version_ret=$?" >> $GITHUB_OUTPUT
env:
GITHUB_TOKEN: ${{ secrets.BOT_PAT }}

- name: Import bot's GPG key for signing commits
id: import-gpg
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.BOT_GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.BOT_GPG_PASSPHRASE }}
#git_config_global: true
git_user_signingkey: true
git_commit_gpgsign: true

- name: Sign commit and push changes
run: |
if [[ "${{ steps.bump-version.outputs.bump_version_ret }}" == "0" ]]; then
git config --global user.email ${{ steps.import-gpg.outputs.name }}
git config --global user.name ${{ steps.import-gpg.outputs.email }}
git commit -S -m "Bump version" build.gradle.kts
git push
fi
env:
# GITHUB_TOKEN: ${{ secrets.BOT_PAT }}
GIT_AUTHOR_NAME: ${{ steps.import-gpg.outputs.name }}
GIT_AUTHOR_EMAIL: ${{ steps.import-gpg.outputs.email }}
GIT_COMMITTER_NAME: ${{ steps.import-gpg.outputs.name }}
GIT_COMMITTER_EMAIL: ${{ steps.import-gpg.outputs.email }}

2 changes: 1 addition & 1 deletion bump_version_gh_action.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

printenv
echo

vercomp () {
if [[ $1 == $2 ]]
Expand Down

0 comments on commit 354c822

Please sign in to comment.