Update Module Info #4
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: Update Module Info | |
on: | |
pull_request: | |
branches: | |
- lava-output | |
paths: | |
- 'scripts/artifacts/**' | |
workflow_dispatch: | |
jobs: | |
update-module-info: | |
runs-on: ubuntu-latest | |
if: github.event_name == 'pull_request' || github.ref == 'refs/heads/lava-output' | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
- name: Run module_info script | |
run: python admin/scripts/module_info.py | |
- name: Check for changes | |
id: git-check | |
run: | | |
git diff --exit-code || echo "changes=true" >> $GITHUB_OUTPUT | |
- name: Commit changes | |
if: steps.git-check.outputs.changes == 'true' | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git add admin/docs/module_info.md | |
git commit -m "Update module_info.md" | |
- name: Push changes | |
if: steps.git-check.outputs.changes == 'true' | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: ${{ github.head_ref || github.ref_name }} |