Markdown files test and update #16
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
on: | |
workflow_dispatch: | |
permissions: | |
contents: write | |
pull-requests: write | |
name: Markdown files test and update | |
jobs: | |
markdown-test-and-update: | |
name: Markdown files test and update | |
runs-on: ubuntu-latest | |
steps: | |
- name: Clone sources | |
uses: actions/checkout@v3 | |
with: | |
path: extension | |
- name: Launch localhost server | |
run: | | |
sudo npm install --global http-server | |
http-server ./extension & | |
- name: Set up Ruby 2.6 | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 2.6 | |
- name: Check links in Markdown files | |
run: | | |
gem install awesome_bot | |
cd extension | |
awesome_bot README.md --skip-save-results --allow-dupe --base-url http://localhost:8080/ | |
awesome_bot doc/*.md --skip-save-results --allow-dupe --white-list repo.magento.com,ddev.site,Composer-plugin-against-Dependency-Confusion-attacks --base-url http://localhost:8080/doc/ | |
- name: Generate table of contents | |
uses: technote-space/toc-generator@v4 | |
with: | |
MAX_HEADER_LEVEL: 5 | |
COMMIT_NAME: CrowdSec Dev Bot | |
TARGET_PATHS: 'doc/*.md' | |
CHECK_ONLY_DEFAULT_BRANCH: true | |
CREATE_PR: true |