Skip to content

Rebase main and dev and add .dev to version #5

Rebase main and dev and add .dev to version

Rebase main and dev and add .dev to version #5

name: Rebase main and dev and add .dev to version
on:
workflow_run:
workflows: ["Tag and Release"]
types:
- completed
workflow_dispatch:
jobs:
rebase:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
fetch-depth: 0
token: ${{ secrets.BOT_ACCESS_TOKEN }}
- name: Setup Git
run: |
git config user.email "github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
- name: Fetch all branches
run: git fetch --all
- name: Rebase dev with main
run: |
git checkout dev
git rebase origin/main
- name: Update the version to <latest>.dev
id: update_version
run: |
version_file="pt_cli/__version__.py"
version_number=$(sed -n "s/__version__ = '\([^']*\)'/\1/p" $version_file)
if [[ "$version_number" != *.dev ]]; then
echo "__version__ = '${version_number}.dev'" > $version_file
fi
- name: Commit changes
run: |
git add pt_cli/__version__.py
git commit -m "Dev Version update"
git push --force-with-lease