Files
slsa-verifier/.github/workflows/pre-submit.actions.yml
2022-10-12 09:15:59 -05:00

42 lines
1.2 KiB
YAML

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@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3.1.0
- name: Set Node.js 16
uses: actions/setup-node@969bd2663942d722d85b6a8626225850c2f7be4b # tag=v3.5.0
with:
node-version: 16
- 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@3cea5372237819ed00197afe530f5a7ea3e805c8
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
with:
name: dist
path: dist/