Check Biome.js Version #249
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Check Biome.js Version | |
on: | |
schedule: | |
- cron: '0 10 * * *' | |
workflow_dispatch: | |
permissions: | |
contents: write | |
jobs: | |
get-version: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
fetch-depth: 0 | |
token: ${{ secrets.PAT_TOKEN }} | |
- name: Fetch release version | |
id: release-version | |
run: | | |
VERSION=$(curl -sL https://api.github.com/repos/biomejs/biome/releases/latest | jq -r ".tag_name" | sed 's/^[^0-9.]*//g') | |
echo "version=$VERSION" >> $GITHUB_OUTPUT | |
echo "modified=$([ $(cat version.txt) == $VERSION ] && echo "false" || echo "true")" >> $GITHUB_OUTPUT | |
- name: Commit latest release version | |
if: steps.release-version.outputs.modified == 'true' | |
run: | | |
git config --global user.name 'Christian van der Loo' | |
git config --global user.email 'chrisvander@users.noreply.github.com' | |
git commit --allow-empty -m "feat: release ${{ steps.release-version.outputs.version }}" -m "Release-As: ${{ steps.release-version.outputs.version }}" | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.PAT_TOKEN }} | |
branch: ${{ github.ref }} |