Skip to content

Get latest release version #137

Get latest release version

Get latest release version #137

Workflow file for this run

name: Get latest release version
on:
schedule:
- cron: '0 11 * * *'
workflow_dispatch:
inputs:
jobs:
get-version:
runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
# persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '20.11'
- name: Install dependencies
run: npm install
- name: Fetch release version
run: npm run get-version
- name: Store Version number in env
run: |
echo "version=$(cat release-version)" >> $GITHUB_ENV
- name: Autocommit latest release version
uses: stefanzweifel/git-auto-commit-action@v5
with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
commit_message: Release version ${{ env.version }}
tagging_message: 'v${{ env.version }}'