From 25769a8612b584e078ccb48dd9fb0f4b89599720 Mon Sep 17 00:00:00 2001 From: GrantBirki Date: Mon, 16 Oct 2023 10:04:49 -0600 Subject: [PATCH] update package-check workflow --- .github/workflows/check-dist.yml | 25 ++++++++++++------------- .node-version | 1 + 2 files changed, 13 insertions(+), 13 deletions(-) create mode 100644 .node-version diff --git a/.github/workflows/check-dist.yml b/.github/workflows/check-dist.yml index 07d5120..59e58dd 100644 --- a/.github/workflows/check-dist.yml +++ b/.github/workflows/check-dist.yml @@ -4,35 +4,34 @@ on: push: branches: - main - paths-ignore: - - "**.md" pull_request: - paths-ignore: - - "**.md" workflow_dispatch: +permissions: + contents: read + jobs: package-check: runs-on: ubuntu-latest steps: - - uses: actions/checkout@7884fcad6b5d53d10323aee724dc68d8b9096a2e # pin@v2 + - uses: actions/checkout@v4 - - name: Setup Node.js 18.x - uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # pin@v3.4.1 + - name: setup node + uses: actions/setup-node@v3.8.1 with: - node-version: 18.x + node-version-file: .node-version cache: 'npm' - - name: Install dependencies + - name: install dependencies run: npm ci - - name: Rebuild the dist/ directory + - name: rebuild the dist/ directory run: npm run bundle - - name: Compare the expected and actual dist/ directories + - name: compare the expected and actual dist/ directories run: | - if [ "$(git diff --text --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then + if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then echo "Detected uncommitted changes after build. See status below:" git diff exit 1 @@ -40,7 +39,7 @@ jobs: id: diff # If index.js was different than expected, upload the expected version as an artifact - - uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # pin@v2 + - uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # pin@v3.1.2 if: ${{ failure() && steps.diff.conclusion == 'failure' }} with: name: dist diff --git a/.node-version b/.node-version new file mode 100644 index 0000000..1cc433a --- /dev/null +++ b/.node-version @@ -0,0 +1 @@ +20.6.0