fix: example commit #45
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
pull_request: | |
branches: | |
- main | |
- ci | |
# Needed for nx-set-shas when run on the main branch | |
permissions: | |
actions: read | |
contents: write | |
checks: write | |
pull-requests: write | |
jobs: | |
main: | |
runs-on: ubuntu-latest | |
if: github.head_ref != 'weblate-postybirb-postybirb' | |
steps: | |
- name: Check out Git repository | |
uses: actions/checkout@v4 | |
with: | |
# Note: By default, the checkout action will only clone the latest commit of the branch, which will cause issues as Nx needs to compute the difference between the base and head. Using the fetch-depth: 0 parameter will clone the entire repository, which is not optimal but functional. | |
fetch-depth: 0 | |
- name: Install Node.js, NPM and Yarn | |
uses: actions/setup-node@v4 | |
with: | |
cache: yarn | |
# Note: This flags needed to speed up build | |
- name: Install dependencies | |
run: NO_POSTINSTALL=1 yarn install --frozen-lockfile --prefer-offline | |
- name: Set git SHA for NX affected | |
uses: nrwl/nx-set-shas@v3 | |
# Note: This step is needed for nx affected to work when CI is running on a PR | |
- name: Track right branch | |
run: npx exitzero git branch --track ci origin/ci | |
- name: Lint changes affected by this pr | |
run: npx exitzero nx affected --parallel -t lint --fix | |