-
Notifications
You must be signed in to change notification settings - Fork 2
61 lines (57 loc) · 2.28 KB
/
rundoc-pr.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
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 0 * * 1"
workflow_dispatch:
jobs:
run-rundoc:
runs-on: pub-hk-ubuntu-24.04-ip
env:
BUNDLE_GEMFILE: .rundoc-workspace/Gemfile
strategy:
matrix:
lang: ["ruby", "dotnet", "nodejs", "python", "php", "go", "java_maven", "java_gradle", "scala"]
fail-fast: false
steps:
- name: Get token for GH application (Linguist)
uses: actions/create-github-app-token@v1
id: generate-token
with:
app-id: ${{ vars.LINGUIST_GH_APP_ID }}
private-key: ${{ secrets.LINGUIST_GH_PRIVATE_KEY }}
- uses: actions/checkout@v4
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/[email protected]
# [CONFIG] add different languages set up here
- run: |
bundle exec rundoc docs/src/${{ matrix.lang }}/RUNDOC.md \
--on-success-dir docs/${{ matrix.lang }} \
--on-failure-dir docs/fail/${{ matrix.lang }} \
--force
continue-on-error: true
- name: Create Pull Request
id: pr
uses: peter-evans/create-pull-request@v7
with:
token: ${{ steps.generate-token.outputs.token }}
branch: rundoc-update-${{ matrix.lang }}
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 }}