Skip to content

Adds rules from Federico Dotta #9

Adds rules from Federico Dotta

Adds rules from Federico Dotta #9

name: READMEs generation
on:
push:
branches:
- main
paths:
- semgrep_rules_manager/data/sources.yaml
- README.template.md
- README.pypi.template.md
- actions/generate_readmes/generate_readmes.py
- .github/workflows/generate_readmes.yaml
pull_request:
branches:
- main
paths:
- semgrep_rules_manager/data/sources.yaml
- README.template.md
- README.pypi.template.md
- actions/generate_readmes/generate_readmes.py
- .github/workflows/generate_readmes.yaml
jobs:
install-requirements:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Python
uses: actions/setup-python@v4
- name: Install Poetry
uses: abatilo/actions-poetry@v2
- name: Setup a local virtual environment
run: |
poetry config virtualenvs.create true --local
poetry config virtualenvs.in-project true --local
- name: Install the project dependencies
run: poetry install --only=main --only=actions
- name: Run the generation script
run: poetry run generate-readmes
- name: Check if the files are modified and commit eventual changes
run: |
if git diff --name-only README.md | grep -q 'README.md'; then
git add README.md
git config --global user.name "README.md Generator"
git config --global user.email "[email protected]"
git commit -a -m "Updates READMEs"
git push
else
echo "README.md is unchanged. The action will stop."
exit 0
fi