Skip to content

FS-3664 Read-only summary flag on the summary page #183

FS-3664 Read-only summary flag on the summary page

FS-3664 Read-only summary flag on the summary page #183

name: Increment version
on:
workflow_dispatch:
pull_request:
types: [opened, reopened]
jobs:
bump-version:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}
token: ${{ secrets.GITHUB_TOKEN }}
# If you have overriden the version in the version file, eg. to do a non-patch release and want to
# take this version as the base, not the latest tag, then uncomment this step and comment out the
# 'Get latest tag' step below. Then put them back!
# - name: "Set version in env"
# id: set-version
# run: |
# source version
# echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: "Get latest tag"
id: latest_tag
run: |
echo "VERSION="$(git for-each-ref --sort=-creatordate --count 1 --format="%(refname:short)" "refs/tags/*") >> $GITHUB_ENV
- name: Bump release version
id: bump_version
uses: christian-draeger/[email protected]
with:
current-version: ${{env.VERSION}}
version-fragment: "bug"
- name: Update version in version file
id: update_version
run: |
echo Updating version from $VERSION to ${{ steps.bump_version.outputs.next-version }}
echo Before updates
head version
sed -i 's/VERSION=${{env.VERSION}}/VERSION=${{ steps.bump_version.outputs.next-version }}/' version
echo After updates
head version
git config user.name 'FSD Github Actions'
git config user.email "[email protected]"
git add version
git commit -m "Update version to ${{ steps.bump_version.outputs.next-version }}"
git push origin $GITHUB_HEAD_REF
echo "Updated version file with version ${{ steps.bump_version.outputs.next-version }}" >> $GITHUB_STEP_SUMMARY