Skip to content

[Infrastructure] Add a github workflow to update NPM dependencies #14

[Infrastructure] Add a github workflow to update NPM dependencies

[Infrastructure] Add a github workflow to update NPM dependencies #14

name: update-npm-dependencies
on:
# Manual run
workflow_dispatch:
pull_request:
permissions:
contents: write
issues: write
pull-requests: write
jobs:
update-npm-dependencies:
runs-on: windows-latest
steps:
- name: Checkout aspnetcore repository
uses: actions/checkout@v4
with:
repository: 'dotnet/aspnetcore'
ref: 'main'
path: 'main'
- name: Checkout Node-Externals repository
uses: actions/checkout@v4
with:
repository: 'dotnet/Node-Externals'
ref: 'main'
path: 'node-externals'
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Run npm install to update package-lock.json
shell: pwsh
id: npm-install-script
run: |
./.github/workflows/update-npm-dependencies.ps1
with:

Check failure on line 42 in .github/workflows/update-npm-dependencies.yml

View workflow run for this annotation

GitHub Actions / update-npm-dependencies

Invalid workflow file

The workflow is not valid. .github/workflows/update-npm-dependencies.yml (Line: 42, Col: 9): Unexpected value 'with' .github/workflows/update-npm-dependencies.yml (Line: 64, Col: 9): Unexpected value 'with'
working-directory: ./main/
- name: Create PR to update the offline package cache
# if: steps.update-npm-dependencies.outputs.changes == 'true'
id: update-offline-package-cache
uses: dotnet/actions-create-pull-request@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
path: ./node-externals/
commit-message: 'Update the NPM offline cache'
title: '[Infrastructure] Update the NPM offline cache'
body: 'Updates the npm offline cache to match the associated package-lock.json file in dotnet/aspnetcore.'
labels: 'Type: Dependency Update :arrow_up_small:'
base: main
branch: github-action/update-npm-dependencies
branch-suffix: timestamp
- name: Update offline-cache submodule
shell: pwsh
run: |
./.github/workflows/update-submodule-commit.ps1 ${{ steps.update-offline-package-cache.outputs.pull-request-head-sha }}
with:
working-directory: ./main/
- name: Create PR to update package-lock.json and the offline package cache submodule
# if: steps.update-npm-dependencies.outputs.changes == 'true'
uses: dotnet/actions-create-pull-request@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: 'Update npm dependencies and offline cache submodule'
path: ./main/
title: '[Infrastructure] Update npm dependencies'
body: 'Updates the package-lock.json file and the offline package cache submodule to match it.'
labels: 'Type: Dependency Update :arrow_up_small:'
base: main
branch: github-action/update-npm-dependencies
branch-suffix: timestamp