diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fe84166..292a180 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,6 +31,7 @@ jobs: - name: Run Tests run: pnpm run test:ci - name: Run Changesets (version or publish) + id: changesets uses: changesets/action@v1.5.3 with: version: pnpm run changeset:version @@ -40,3 +41,18 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + - name: Commit Generated Docs + if: steps.changesets.outputs.published == 'true' + run: | + if [[ -n $(git status --porcelain) ]]; then + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + BRANCH_NAME="docs/auto-update-$(date +%s)" + git checkout -b $BRANCH_NAME + git add . + git commit -m "docs: regenerate API documentation" + git push origin $BRANCH_NAME + gh pr create --title "docs: regenerate API documentation" --body "Automated documentation update from release" --base main --head $BRANCH_NAME + fi + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/package.json b/package.json index f1736a4..374baaa 100644 --- a/package.json +++ b/package.json @@ -10,8 +10,8 @@ "scripts": { "clean": "pnpm --filter \"./packages/**\" run clean", "test": "pnpm run test:ci", - "test:pr": "nx affected --targets=test:sherif,test:knip,test:docs,test:eslint,test:lib,test:types,test:build,build", - "test:ci": "nx run-many --targets=test:sherif,test:knip,test:docs,test:eslint,test:lib,test:types,test:build,build", + "test:pr": "nx affected --targets=test:sherif,test:knip,test:eslint,test:lib,test:types,test:build,build", + "test:ci": "nx run-many --targets=test:sherif,test:knip,test:eslint,test:lib,test:types,test:build,build", "test:eslint": "nx affected --target=test:eslint --exclude=examples/**", "test:format": "pnpm run prettier --check", "test:sherif": "sherif", @@ -37,7 +37,6 @@ }, "nx": { "includedScripts": [ - "test:docs", "test:knip", "test:sherif" ]