Skip to content

Commit

Permalink
fix: ensure ci process can run on main branch
Browse files Browse the repository at this point in the history
  • Loading branch information
lwhiteley committed Jan 5, 2024
1 parent 7a62faf commit c2de6ef
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
- uses: nrwl/nx-set-shas@v3
# This line is needed for nx affected to work when CI is running on a PR
- run: git branch --track main origin/main
if: github.ref == 'refs/heads/main'

- run: pnpm nx affected -t test,build --parallel=3 --projects=tag:publish
- run: pnpm nx run-many -t publish --projects=tag:publish --tag latest
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ jobs:
- uses: nrwl/nx-set-shas@v3
# This line is needed for nx affected to work when CI is running on a PR
- run: git branch --track main origin/main
if: github.ref == 'refs/heads/main'

- run: pnpm nx format:check
- run: pnpm nx affected -t lint,test --parallel=3

# Should be run last
- name: Tag main branch if all jobs succeed
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
uses: nrwl/nx-tag-successful-ci-run@v1
with:
remove-tags-matching-pattern: 'nx_successful_ci_run__'
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"start": "nx serve",
"build": "nx build",
"test": "nx test",
"release": "release-it"
"release": "release-it",
"git:clean-tags": "git tag -l | xargs git tag -d && git fetch -t"
},
"private": true,
"dependencies": {
Expand Down

0 comments on commit c2de6ef

Please sign in to comment.