Skip to content

Change app version in PR 609 #1404

Change app version in PR 609

Change app version in PR 609 #1404

Workflow file for this run

name: Change app version
run-name: Change app version in PR ${{ github.event.number }}
on:
pull_request:
branches: [ "develop" ]
workflow_dispatch:
permissions:
contents: write
jobs:
update-version-and-push:
if: github.event.pull_request.head.repo.fork == false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}
token: ${{ secrets.UNN_MOBILE_AUTO_KEY }}
- run: |
sed -i "/version:/s/\(\([0-9]\+\.\)\{2\}[0-9]\+\)+[0-9]\+/\1+$(($(git rev-list --count origin/develop) + 1))/" pubspec.yaml
git config --global user.name "UNN MOBILE runner"
git config --global user.email "[email protected]"
if ! git diff --quiet --exit-code pubspec.yaml; then git add pubspec.yaml; git commit -m "Change version in pubspec"; git push; fi