Skip to content

Workflow file for this run

name: Bump version on PR
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 }}