1- name : Update dependencies and Docs
1+ name : Generate Docs
22
33on :
44 push :
55 branches : [main]
6- schedule :
7- - cron : " 0 */8 * * * "
6+ workflow_dispatch :
7+
88jobs :
99 generate-docs :
10- if : github.event.repository.owner.login == 'react18-tools'
10+ if : github.run_number != 1 && github. event.repository.owner.login == 'react18-tools'
1111 runs-on : ubuntu-latest
1212 permissions :
1313 contents : write
1414 steps :
1515 - uses : actions/checkout@v4
1616 with :
1717 token : ${{ secrets.GITHUB_TOKEN }}
18+ ref : ${{ github.event.before }}
19+
20+ - name : Check if package.json was modified
21+ id : pub
22+ run : |
23+ git fetch origin main && git checkout main
24+ if git diff --name-only ${{ github.event.before }} HEAD | grep -q "lib/package.json"; then
25+ echo "file_changed=true" >> $GITHUB_ENV
26+ else
27+ echo "file_changed=false" >> $GITHUB_ENV
28+ fi
29+
30+ - name : Exit early if lib/package.json was modified
31+ if : env.file_changed == 'true'
32+ run : exit 1
1833
1934 - uses : actions/setup-node@v4
2035 with :
@@ -27,17 +42,11 @@ jobs:
2742 git fetch
2843 git checkout main
2944 git pull
30- - run : npm i -g pnpm && pnpm i
45+ - run : npm i -g pnpm && pnpm i --no-frozen-lockfile
3146 name : Install dependencies
32- - run : git status && git clean -f -d && git status
47+ - run : git stash --include-untracked
3348 name : clean up working directory
34- - run : npx @turbo/codemod update . && pnpm update --latest -r
35- name : Update dependencies
36- - run : pnpm build --filter @example/nextjs
37- name : Build all apps to make sure it is not broken due to dependency upgrades
38- - name : Run unit tests
39- run : pnpm test
4049 - name : Generate/update docs
4150 run : pnpm doc
42- - name : Save upgraded packages back to repo
43- run : git add . && git commit -m "upgrade deps && docs" && git push origin main
51+ - name : Save docs back to repo
52+ run : git add . && git commit -m "upgrade deps && docs [skip ci] " && git push origin main
0 commit comments