Skip to content

Commit

Permalink
create gh action
Browse files Browse the repository at this point in the history
  • Loading branch information
bgonp committed May 22, 2024
1 parent 0be1cfd commit 349307e
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: "Look for broken links to documentation"

on:
pull_request:
types: [opened, synchronize]
# schedule:
# # Every day at 00:00 UTC
# - cron: '0 0 * * *'

jobs:
run-docs-test:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Run the docs test
run: false

- name: Create PR if test failed
if: failure()
run: |
echo "PR_TITLE=\"Fixing broken documentation links\"" >> $GITHUB_ENV
echo "RUN_URL=\"${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}\"" >> $GITHUB_ENV
echo "PR_BODY=\"Some links to the documentation are broken.\nSee: $RUN_URL\"" >> $GITHUB_ENV
echo "PR_BRANCH=\"fix-broken-docs-links-${{ github.run_id }}\"" >> $GITHUB_ENV
git switch -c $PR_BRANCH
git push
gh pr create \
--draft \
--title $PR_TITLE \
--body $PR_BODY \
--base master \
--head $PR_BRANCH \
--label "bug"

0 comments on commit 349307e

Please sign in to comment.