Skip to content

Workflow file for this run

name: Update README with Latest Version
on:
release:
types: [created]
permissions:
contents: write # Grant write permission to the contents
jobs:
update-readme:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Get Release Tag Name
id: get_tag_name
run: echo "RELEASE_TAG=${{ github.event.release.tag_name }}" >> $GITHUB_ENV
- name: Extract Version Number
id: extract_version
run: echo "::set-output name=VERSION::${{ env.RELEASE_TAG:1 }}"

Check failure on line 24 in .github/workflows/update-version.yml

View workflow run for this annotation

GitHub Actions / Update README with Latest Version

Invalid workflow file

The workflow is not valid. .github/workflows/update-version.yml (Line: 24, Col: 14): Unexpected symbol: 'RELEASE_TAG:1'. Located at position 5 within expression: env.RELEASE_TAG:1

Check failure on line 24 in .github/workflows/update-version.yml

View workflow run for this annotation

GitHub Actions / Update README with Latest Version

Invalid workflow file

The workflow is not valid. .github/workflows/update-version.yml (Line: 24, Col: 14): Unexpected symbol: 'RELEASE_TAG:1'. Located at position 5 within expression: env.RELEASE_TAG:1

Check failure on line 24 in .github/workflows/update-version.yml

View workflow run for this annotation

GitHub Actions / Update README with Latest Version

Invalid workflow file

The workflow is not valid. .github/workflows/update-version.yml (Line: 24, Col: 14): Unexpected symbol: 'RELEASE_TAG:1'. Located at position 5 within expression: env.RELEASE_TAG:1

Check failure on line 24 in .github/workflows/update-version.yml

View workflow run for this annotation

GitHub Actions / Update README with Latest Version

Invalid workflow file

The workflow is not valid. .github/workflows/update-version.yml (Line: 24, Col: 14): Unexpected symbol: 'RELEASE_TAG:1'. Located at position 5 within expression: env.RELEASE_TAG:1
- name: Update README.md
run: |
LATEST_VERSION=${{ steps.extract_version.outputs.VERSION }}
# Replace the version string in the Gradle dependency line
sed -i "s/de\.derioo:javautils:[0-9]*\.[0-9]*\.[0-9]*/de.derioo:javautils:${LATEST_VERSION}/g" README.md
# Replace the version string in the Maven dependency line
sed -i "s/<version>[0-9]*\.[0-9]*\.[0-9]*<\/version>/<version>${LATEST_VERSION}<\/version>/g" README.md
- name: Commit and Push Changes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git checkout -b update-readme-with-latest-version
git add README.md
git commit -m "Update README with latest version ${{ env.RELEASE_TAG }}"
git push --force origin update-readme-with-latest-version:main