Process en branch #27
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
| # The name of this GH action | |
| name: Process en branch | |
| # Defines when this action should be run | |
| on: | |
| # Run on any Push | |
| push: | |
| branches: | |
| - en | |
| # Allow manual triggering | |
| workflow_dispatch: | |
| jobs: | |
| # A task that processes OpenAPI files from the en branch | |
| process-en-branch: | |
| # We run this on the latest ubuntu | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| strategy: | |
| matrix: | |
| node-version: [24.x] | |
| steps: | |
| - name: Check out scripts from main branch | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: refs/heads/main | |
| sparse-checkout: | | |
| .github/scripts | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Check out api schemas from en branch | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: refs/heads/en | |
| path: api-schemas | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| - name: Install script dependencies | |
| working-directory: .github/scripts | |
| run: npm install | |
| - name: Run add-code-samples script | |
| working-directory: .github/scripts | |
| run: npm run add-code-samples -- "../../api-schemas" "openapi.*\\.json" | |
| - name: Run add-code-samples script | |
| run: echo "README" > api-schemas/README.md | |
| - name: Push processed files to en-api-docs branch | |
| uses: s0/[email protected] | |
| env: | |
| REPO: self | |
| BRANCH: refs/heads/en-api-docs | |
| FOLDER: api-schemas | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |