From 35e99821a2b11a129889a79d9bd74a2ebfaffd98 Mon Sep 17 00:00:00 2001 From: Javier Calvarro Nelson Date: Fri, 22 Mar 2024 17:20:23 +0100 Subject: [PATCH] [Infrastructure] Add a workflow to validate package-lock.json when changes are introduced. (#54688) When package-lock.json is updated, we will run npm ci --prefer-online to force checking the contents of the package-lock.json against the AzDo feeds. --- .../validate-npm-package-lock-json.yml | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/validate-npm-package-lock-json.yml diff --git a/.github/workflows/validate-npm-package-lock-json.yml b/.github/workflows/validate-npm-package-lock-json.yml new file mode 100644 index 00000000000..74517b15378 --- /dev/null +++ b/.github/workflows/validate-npm-package-lock-json.yml @@ -0,0 +1,30 @@ +name: Validate package-lock.json against source feeds + +on: + # Manual run + workflow_dispatch: + pull_request: + paths: + - 'package-lock.json' + +jobs: + validate-package-lock-json: + name: 'Validate package-lock.json against source feeds' + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + submodules: false + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: 20.x + + - name: Run npm ci to validate package-lock.json against the feed + shell: pwsh + id: npm-install-script + run: npm ci --prefer-online --fetch-retries 5 \ No newline at end of file