name: Actions pre submits on: pull_request: branches: [main] workflow_dispatch: permissions: read-all jobs: check-dist: runs-on: ubuntu-latest steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Set Node.js 20 uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 with: node-version: 20 - name: Rebuild the dist/ directory working-directory: actions/installer run: make package - name: Compare the expected and actual dist/ directories working-directory: actions/installer id: diff run: | set -euo pipefail 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 fi # If index.js was different from expected, upload the expected version as an artifact - uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0 if: ${{ failure() && steps.diff.conclusion == 'failure' }} with: name: dist path: dist/