execute rundoc on tutorials #118
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: execute rundoc on tutorials | |
| run-name: execute rundoc on tutorials | |
| on: | |
| schedule: | |
| # This schedule triggers the workflow at 00:00 every Monday | |
| - cron: "0 8 * * 1" | |
| workflow_dispatch: | |
| # Disable all GITHUB_TOKEN permissions, since the GitHub App token is used instead. | |
| permissions: {} | |
| jobs: | |
| run-rundoc: | |
| runs-on: pub-hk-ubuntu-24.04-ip | |
| env: | |
| BUNDLE_GEMFILE: .rundoc-workspace/Gemfile | |
| steps: | |
| - name: Get token for GH application (Linguist) | |
| uses: actions/create-github-app-token@v3 | |
| id: generate-token | |
| with: | |
| app-id: ${{ vars.LINGUIST_GH_APP_ID }} | |
| private-key: ${{ secrets.LINGUIST_GH_PRIVATE_KEY }} | |
| - uses: actions/checkout@v6 | |
| with: | |
| ref: ${{ github.head_ref }} | |
| token: ${{ steps.generate-token.outputs.token }} | |
| - uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: "3.3" | |
| bundler-cache: true # do run 'bundle install' and cache | |
| - uses: buildpacks/github-actions/setup-pack@06e250da5bb4ccb9a2103719a21d2a7f2252fe83 # v5.11.0 | |
| - name: Run rundoc for all languages | |
| run: | | |
| langs=("ruby" "dotnet" "nodejs" "python" "php" "go" "java_maven" "java_gradle" "scala") | |
| for lang in "${langs[@]}"; do | |
| bundle exec rundoc docs/src/$lang/RUNDOC.md \ | |
| --on-success-dir docs/$lang \ | |
| --on-failure-dir docs/fail/$lang \ | |
| --force | |
| done | |
| continue-on-error: true | |
| - name: Create Pull Request | |
| id: pr | |
| uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0 | |
| with: | |
| token: ${{ steps.generate-token.outputs.token }} | |
| branch: rundoc-update | |
| delete-branch: true | |
| base: main | |
| commit-message: Update tutorials | |
| title: Update tutorials | |
| body: "generated by the [run-rundoc linux github action](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})" | |
| committer: ${{ vars.LINGUIST_GH_APP_USERNAME }} <${{ vars.LINGUIST_GH_APP_EMAIL }}> | |
| author: ${{ vars.LINGUIST_GH_APP_USERNAME }} <${{ vars.LINGUIST_GH_APP_EMAIL }}> | |
| - name: Enable PR auto-merge | |
| if: steps.pr.outputs.pull-request-operation == 'created' | |
| run: gh pr merge --auto --squash "${{ steps.pr.outputs.pull-request-number }}" | |
| env: | |
| GH_TOKEN: ${{ steps.generate-token.outputs.token }} |