Skip to content

Bump the npm_and_yarn group across 3 directories with 2 updates #348

Bump the npm_and_yarn group across 3 directories with 2 updates

Bump the npm_and_yarn group across 3 directories with 2 updates #348

Workflow file for this run

# Autochecks the repo, using formatting and linting commands we run on precommit JUUUUST to be sure
name: Autochecks
on:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
jobs:
autocheck:
timeout-minutes: 5
runs-on: ubuntu-latest
strategy:
matrix:
# Each of these are commands we should run and check output
command: ['lint', 'lint:types', 'format']
outputs:
lint: ${{ steps.changes.outputs.lint }}
linttypes: ${{ steps.changes.outputs.linttypes }}
format: ${{ steps.changes.outputs.format }}
name: ${{ matrix.command }}
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v3
with:
node-version-file: .node-version
cache: 'pnpm'
- run: pnpm install
- name: ${{ matrix.command }}
run: NODE_OPTIONS=--max_old_space_size=8192 pnpm turbo ${{ matrix.command }}
- name: Output changed files
id: changes
# Removes both leading/trailing whitespace after getting diffed files and removing package.json/pnpm.lock
run: |
CHANGED="$(git diff --name-only --diff-filter=ACMRT | xargs | sed 's/package.json//g;s/pnpm.lock//g;s/^[ \t]*//g;s/[ \t]*$//g')"
COMMAND_NAME="${{ matrix.command }}"
OUTPUTNAME="${COMMAND_NAME//:/}"
echo "Changed files were: $CHANGED"
echo "$OUTPUTNAME=$CHANGED" >> $GITHUB_OUTPUT
# This will output error if any of the above steps changed files
diff-output:
name: Diff files after autochecks
timeout-minutes: 5
runs-on: ubuntu-latest
needs: autocheck
steps:
- name: Autochecked files changed output
if: ${{ needs.autocheck.outputs.lint || needs.autocheck.outputs.linttypes || needs.autocheck.outputs.format }}
run: |
echo "Changed from lint: ${{needs.autocheck.outputs.lint || 'none'}}"
echo "Type check changed files: ${{needs.autocheck.outputs.linttypes || 'none'}}"
echo "Files formatted: ${{needs.autocheck.outputs.format || 'none'}}"
exit 1
- name: No changes found
if: ${{ !needs.autocheck.outputs.lint && !needs.autocheck.outputs.linttypes && !needs.autocheck.outputs.format }}
run: |
echo "No changes from autochecks"