[New Tool]: Doc Generator #4
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Comment on Failed Test | |
on: | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
jobs: | |
comment_on_failed_test: | |
name: Check Generator Templates | |
runs-on: ubuntu-22.04 | |
container: | |
image: crystallang/crystal | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 | |
- name: Run generator tests | |
run: crystal document-generator/scripts/check_docs.cr | |
- name: Comment on PR if test failed | |
if: failure() | |
uses: actions/github-script@v7 | |
with: | |
github-token: ${{ secrets.github_membership_token || secrets.GITHUB_TOKEN }} | |
script: | | |
const prNumber = context.payload.pull_request.number; | |
const comment = `Hello!. Thanks for opening this pr.🙂\n\n. On the Crystal-lang repo we use a doc generator to generate all introduction.md files. The tool is located in the document-generator folder. Our tooling has noticed that they are out of sync of the about.md file, this can be caused of 2 reasons:\n\n 1. You have updated an introduction.md file instead of updating the concepts about.md file\n2. You have updated the about.md file but haven't synced.`; | |
await github.issues.createComment({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
issue_number: prNumber, | |
body: comment, | |
}); |