Skip to content

Commit 50ce145

Browse files
committed
create gh action
1 parent 0be1cfd commit 50ce145

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

.github/workflows/test.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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+
run: |
24+
export PR_TITLE="Fixing broken documentation links"
25+
export RUN_URL="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
26+
export PR_BODY="Some links to the documentation are broken.\nSee: $RUN_URL"
27+
export PR_BRANCH="fix-broken-docs-links-${{ github.run_id }}"
28+
29+
git switch -c $PR_BRANCH
30+
git push
31+
gh pr create \
32+
--draft \
33+
--title $PR_TITLE \
34+
--body $PR_BODY \
35+
--base master \
36+
--head $PR_BRANCH \
37+
--label "bug"

0 commit comments

Comments
 (0)