Skip to content

feat: show Fink version in Footer #1

feat: show Fink version in Footer

feat: show Fink version in Footer #1

name: Update Fink version file
on:
push:
branches:
- "main"
paths:
- "inlang/source-code/editor/*"
pull_request:
branches:
- "main"
paths:
- "inlang/source-code/editor/*"
jobs:
update-fink-version:
name: Update Fink version file
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 20
- name: Set up pnpm
uses: pnpm/action-setup@v2
with:
version: 9
- name: Install pnpm
run: npm install -g pnpm
- name: Fetch package versions
run: pnpm m ls --depth -1 --json > pnpm-output.json
- name: Update version.json file
run: |
INLANG_VERSION=$(jq -r '.[] | select(.name == "@inlang/sdk") | .version' ./pnpm-output.json)
LIX_VERSION=$(jq -r '.[] | select(.name == "@lix-js/client") | .version' ./pnpm-output.json)
COMMIT_HASH=$(git rev-parse HEAD)
jq --arg inlang_version "$INLANG_VERSION" --arg lix_version "$LIX_VERSION" --arg commit_hash "$COMMIT_HASH" \
'.["@inlang/sdk"] = $inlang_version | .["@lix-js/client"] = $lix_version | .["commit-hash"] = $commit_hash' ./inlang/source-code/editor/version.json > temp.json && mv temp.json ./inlang/source-code/editor/version.json
- name: Commit and push changes
run: |
git config --local user.email "[email protected]"
git config --local user.name "inlang-bot"
git add ./inlang/source-code/editor/version.json
git commit -m "Update package versions and commit hash"
git push