Skip to content

Commit 6b43787

Browse files
committed
create gh action
1 parent 0be1cfd commit 6b43787

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

.github/workflows/test.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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+
defaults:
15+
run:
16+
working-directory: frontend
17+
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
22+
- name: Run the docs test
23+
run: false
24+
25+
- name: Create PR if test failed
26+
if: failure()
27+
env:
28+
PR_TITLE: "Fix broken documentation links"
29+
PR_BODY: "Some links to the documentation are broken.\nSee: {{ github.server_url }}/{{ github.repository }}/actions/runs/{{ github.run_id }}"
30+
PR_BRANCH: "fix-broken-docs-links-{{ github.run_id }}"
31+
run: |
32+
git switch -c ${{ env.PR_BRANCH }}
33+
git push
34+
gh pr create \
35+
--draft \
36+
--title "${{ env.PR_TITLE }}" \
37+
--body "${{ env.PR_BODY }}" \
38+
--base master \
39+
--head "${{ env.PR_BRANCH }}" \
40+
--label "ch: frontend"

0 commit comments

Comments
 (0)