Skip to content

Commit d003fd6

Browse files
committed
create gh action
1 parent 0be1cfd commit d003fd6

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

.github/workflows/test.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: "Look for broken links to documentation"
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize]
6+
# schedule:
7+
# # Every day at 00:00 UTC
8+
# - cron: '0 0 * * *'
9+
10+
jobs:
11+
run-docs-test:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
18+
- name: Run the docs test
19+
run: false
20+
21+
- name: Create PR if test failed
22+
if: failure()
23+
env:
24+
PR_TITLE: "Fix broken documentation links"
25+
PR_BODY: "Some links to the documentation are broken.\nSee: {{ github.server_url }}/{{ github.repository }}/actions/runs/{{ github.run_id }}"
26+
PR_BRANCH: "fix-broken-docs-links-{{ github.run_id }}"
27+
run: |
28+
git switch -c ${{ env.PR_BRANCH }}
29+
git push
30+
gh pr create \
31+
--draft \
32+
--title "${{ env.PR_TITLE }}" \
33+
--body "${{ env.PR_BODY }}" \
34+
--base master \
35+
--head "${{ env.PR_BRANCH }}" \
36+
--label "ch: frontend"

0 commit comments

Comments
 (0)