Agent Post Release #227
This file contains hidden or 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: Agent Post Release | |
| # Docs PR creation uses NODE_AGENT_GH_TOKEN against the docs-website repo, not GITHUB_TOKEN. | |
| permissions: | |
| contents: read | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| repo_target: | |
| description: Generate the docs for the local repo, the docs repo, or both. | |
| required: true | |
| type: choice | |
| default: both | |
| options: | |
| - local | |
| - docs | |
| - both | |
| workflow_run: | |
| workflows: ["Create Release"] | |
| types: | |
| - completed | |
| jobs: | |
| local: | |
| # `public-docs` commits/pushes the docs to the `gh-pages` branch | |
| permissions: | |
| contents: write | |
| runs-on: ubuntu-latest | |
| if: | |
| (github.event.workflow_run && github.event.workflow_run.conclusion == 'success') || | |
| (github.event_name == 'workflow_dispatch' && | |
| (inputs.repo_target == 'local' || inputs.repo_target == 'both')) | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 2 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 'lts/*' | |
| check-latest: true | |
| - run: npm install | |
| - run: | | |
| git config user.name ${GITHUB_ACTOR} | |
| git config user.email gh-actions-${GITHUB_ACTOR}@github.com | |
| - run: npm run publish-docs | |
| docs: | |
| runs-on: ubuntu-latest | |
| if: | |
| (github.event.workflow_run && github.event.workflow_run.conclusion == 'success') || | |
| (github.event_name == 'workflow_dispatch' && | |
| (inputs.repo_target == 'docs' || inputs.repo_target == 'both')) | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 2 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 'lts/*' | |
| check-latest: true | |
| - run: npm install | |
| - run: | | |
| git config user.name ${GITHUB_ACTOR} | |
| git config user.email gh-actions-${GITHUB_ACTOR}@github.com | |
| - id: get_tag | |
| run: jq -r '"version=\(.version)"' ./package.json >> $GITHUB_OUTPUT | |
| - name: Create Docs Website PR | |
| run: node ./bin/create-docs-pr.js --tag v${{ steps.get_tag.outputs.version }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.NODE_AGENT_GH_TOKEN }} | |
| GITHUB_USER: ${{ vars.NODE_AGENT_CI_USER_NAME }} | |
| GITHUB_EMAIL: ${{ vars.NODE_AGENT_CI_USER_EMAIL }} |