From 60025b2a8afba076c9d5e02efd4bd9a930b2fe90 Mon Sep 17 00:00:00 2001 From: Mobsuccess Bot Date: Tue, 4 Aug 2026 10:56:58 +0000 Subject: [PATCH 1/2] chore(gha): update npm.yml GitHub workflow --- .github/workflows/npm.yml | 106 +++++++++++++++++++++++++------------- 1 file changed, 71 insertions(+), 35 deletions(-) diff --git a/.github/workflows/npm.yml b/.github/workflows/npm.yml index 47f5c53..66e5927 100644 --- a/.github/workflows/npm.yml +++ b/.github/workflows/npm.yml @@ -14,28 +14,58 @@ name: NPM jobs: packagejsonlint: name: PackageJsonLint - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 timeout-minutes: 1 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v7 - uses: mobsuccess-devops/github-actions-packagejsonlint@master + sortpackagejson: + name: Sort Package Json + runs-on: ubuntu-24.04 + timeout-minutes: 7 + steps: + - uses: actions/checkout@v7 + - uses: actions/setup-node@v7 + with: + node-version: 24 + - run: npm install -g npm@11.10.0 + name: Upgrade npm + - name: Cache Node Modules + id: cache + uses: actions/cache@v6 + env: + cache-name: cache-node-modules + with: + path: ./node_modules + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}-${{ hashFiles('**/package-lock.json') }}-node-24 + - run: echo "//npm.pkg.github.com/:_authToken=${{ secrets.MS_READ_PACKAGES_GITHUB_PAT }}" >> ~/.npmrc + name: Configure Credentials For GitHub Packages + - run: npm ci + if: steps.cache.outputs.cache-hit != 'true' + working-directory: . + - run: | + echo "💡 👉 Check not passing? see the doc at https://www.notion.so/mobsuccess/sort-package-json-de5cf4648e8545dbb5a2a5a910380535" + npx --yes sort-package-json@2.4.1 --check + working-directory: . prettier: name: Prettier - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 timeout-minutes: 7 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v7 + - uses: actions/setup-node@v7 with: - node-version: 16.16.0 + node-version: 24 + - run: npm install -g npm@11.10.0 + name: Upgrade npm - name: Cache Node Modules id: cache - uses: actions/cache@v3 + uses: actions/cache@v6 env: cache-name: cache-node-modules with: path: ./node_modules - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}-${{ hashFiles('**/package-lock.json') }}-node-16.16.0 + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}-${{ hashFiles('**/package-lock.json') }}-node-24 - run: echo "//npm.pkg.github.com/:_authToken=${{ secrets.MS_READ_PACKAGES_GITHUB_PAT }}" >> ~/.npmrc name: Configure Credentials For GitHub Packages - run: npm ci @@ -45,21 +75,23 @@ jobs: working-directory: . eslint: name: Eslint - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 timeout-minutes: 7 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v7 + - uses: actions/setup-node@v7 with: - node-version: 16.16.0 + node-version: 24 + - run: npm install -g npm@11.10.0 + name: Upgrade npm - name: Cache Node Modules id: cache - uses: actions/cache@v3 + uses: actions/cache@v6 env: cache-name: cache-node-modules with: path: ./node_modules - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}-${{ hashFiles('**/package-lock.json') }}-node-16.16.0 + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}-${{ hashFiles('**/package-lock.json') }}-node-24 - run: echo "//npm.pkg.github.com/:_authToken=${{ secrets.MS_READ_PACKAGES_GITHUB_PAT }}" >> ~/.npmrc name: Configure Credentials For GitHub Packages - run: npm ci @@ -69,21 +101,23 @@ jobs: working-directory: . test: name: Test - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 timeout-minutes: 7 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v7 + - uses: actions/setup-node@v7 with: - node-version: 16.16.0 + node-version: 24 + - run: npm install -g npm@11.10.0 + name: Upgrade npm - name: Cache Node Modules id: cache - uses: actions/cache@v3 + uses: actions/cache@v6 env: cache-name: cache-node-modules with: path: ./node_modules - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}-${{ hashFiles('**/package-lock.json') }}-node-16.16.0 + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}-${{ hashFiles('**/package-lock.json') }}-node-24 - run: echo "//npm.pkg.github.com/:_authToken=${{ secrets.MS_READ_PACKAGES_GITHUB_PAT }}" >> ~/.npmrc name: Configure Credentials For GitHub Packages - run: npm ci @@ -92,9 +126,9 @@ jobs: - run: npm run test working-directory: . postBuild: - needs: [packagejsonlint, prettier, eslint, test] + needs: [packagejsonlint, sortpackagejson, prettier, eslint, test] name: Post-Build - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 timeout-minutes: 2 outputs: needsPackage: ${{ steps.checkEligibility.outputs.needsPackage }} @@ -128,24 +162,26 @@ jobs: package: needs: [postBuild] name: Package - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 timeout-minutes: 2 outputs: packageVersion: ${{ steps.outputPackageVersion.outputs.packageVersion }} if: needs.postBuild.outputs.needsPackage == 'true' steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v7 + - uses: actions/setup-node@v7 with: - node-version: 16.16.0 + node-version: 24 + - run: npm install -g npm@11.10.0 + name: Upgrade npm - name: Cache Node Modules id: cache - uses: actions/cache@v3 + uses: actions/cache@v6 env: cache-name: cache-node-modules with: path: ./node_modules - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}-${{ hashFiles('**/package-lock.json') }}-node-16.16.0 + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}-${{ hashFiles('**/package-lock.json') }}-node-24 - run: echo "//npm.pkg.github.com/:_authToken=${{ secrets.MS_READ_PACKAGES_GITHUB_PAT }}" >> ~/.npmrc name: Configure Credentials For GitHub Packages - run: npm ci @@ -189,25 +225,25 @@ jobs: - run: npm pack working-directory: . - name: Upload - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v7 with: name: package path: "*.tgz" publish: name: "Publish to GitHub Packages" needs: [postBuild, package] - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 timeout-minutes: 2 if: needs.postBuild.outputs.needsPackage == 'true' steps: - - uses: actions/checkout@v3 - - name: Upload - uses: actions/download-artifact@v2 + - uses: actions/checkout@v7 + - name: Download + uses: actions/download-artifact@v8 with: name: package - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v7 with: - node-version: 16.16.0 + node-version: 24 registry-url: https://npm.pkg.github.com/ scope: "@mobsuccess-devops" - run: echo "registry=https://npm.pkg.github.com/@mobsuccess-devops" >> .npmrc From 5049ee8b5a44dd4936b644b9e787e5b069f5b40d Mon Sep 17 00:00:00 2001 From: "jean-vincent.d-adda" Date: Tue, 1 Sep 2026 10:30:39 +0200 Subject: [PATCH 2/2] chore: sort package.json Co-Authored-By: Claude Opus 5 --- package.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 5caf3ce..42c642a 100644 --- a/package.json +++ b/package.json @@ -2,21 +2,21 @@ "name": "@mobsuccess-devops/github-actions-packagejsonlint", "version": "1.0.0", "description": "", + "license": "UNLICENSED", + "author": "", "main": "index.js", - "publishConfig": { - "registry": "https://npm.pkg.github.com" - }, "scripts": { - "prettier": "npx prettier -c .", "eslint": "npx eslint .", + "prettier": "npx prettier -c .", "test": "jest" }, - "author": "", - "license": "UNLICENSED", "devDependencies": { "@types/jest": "^29.2.4", "eslint": "^8.39.0", "jest": "^29.3.1", "prettier": "^2.8.8" + }, + "publishConfig": { + "registry": "https://npm.pkg.github.com" } }