Skip to content

Revert to snapshot after release #33

Revert to snapshot after release

Revert to snapshot after release #33

Workflow file for this run

name: Revert to snapshot after release
on:
workflow_run:
workflows: ["Release to the Maven repository"]
types:
- completed
jobs:
revert:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- name: Checkout main
uses: actions/checkout@v5
with:
persist-credentials: false
fetch-depth: 0
ref: main
- name: Extract version from project.yml
run: |
current=$(grep 'current-version:' .github/project.yml | awk '{print $2}' | tr -d '"')
next=$(grep 'next-version:' .github/project.yml | awk '{print $2}' | tr -d '"')
echo "CURRENT_VERSION=$current" >> $GITHUB_ENV
echo "NEXT_VERSION=$next" >> $GITHUB_ENV
- name: Revert pom.xml to ${{env.NEXT_VERSION}}
run: |
./mvnw versions:set -DnewVersion=${{env.NEXT_VERSION}}
./mvnw -f samples/pom.xml versions:use-dep-version -Dincludes=com.ibm.watsonx:watsonx-ai -DdepVersion=${{env.CURRENT_VERSION}} -DforceVersion=true
- name: Commit revert
uses: ./.github/actions/commit-push
with:
commit_message: "Prepare for next development iteration"
env:
GITHUB_TOKEN: ${{ secrets.GH_BOT_TOKEN }}