Update Node.js to v22 #1430
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
# Workflow for a javascript dependency change via pull request | |
name: Javascript dependency | |
on: | |
pull_request: | |
branches: | |
- development | |
paths: | |
- web/autosubliminal/package.json | |
- web/autosubliminal/package-lock.json | |
#- web/autosubliminal/src/** # trigger build for all src changes | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
dependency-js: | |
defaults: | |
run: | |
shell: bash | |
working-directory: web/autosubliminal | |
runs-on: windows-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.head_ref }} # required for on:pull_request | |
- name: Print concurrency group | |
run: | | |
echo "${{ github.workflow }}-${{ github.ref }}" | |
- name: Get node version | |
id: get-node-version | |
run: | | |
echo "node-version=$(jq -r '.engines.node' package.json | sed 's/[>=]//g')" >> $GITHUB_OUTPUT | |
- name: Set up node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ steps.get-node-version.outputs.node-version }} | |
- name: Print node version | |
run: | | |
echo "Node version $(node --version)" | |
echo "Npm version $(npm --version)" | |
- name: Install js dependency | |
run: | | |
npm install | |
- name: Build application | |
run: | | |
npm run build | |
- name: Check changes | |
id: check-changes | |
run: | | |
echo "Changed files:" | |
git status --porcelain | |
echo "Checking for real changes (ignoring line endings)" | |
changes=$(if $(git diff --quiet); then echo "false"; else echo "true"; fi) | |
echo "Changes detected: $changes" | |
echo "changes=$changes" >> $GITHUB_OUTPUT | |
- name: Commit changes | |
if: ${{ steps.check-changes.outputs.changes == 'true' }} | |
run: | | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
git add --all | |
git commit --message "Install dependency and build application" --author "h3llrais3r <[email protected]>" | |
git push | |
- name: Add labels | |
if: ${{ steps.check-changes.outputs.changes == 'true' }} | |
uses: actions-ecosystem/action-add-labels@v1 | |
with: | |
labels: "source changes" | |
- name: Remove labels | |
if: ${{ steps.check-changes.outputs.changes == 'false' }} | |
uses: actions-ecosystem/action-remove-labels@v1 | |
with: | |
labels: "source changes" |