Skip to content

Code cleaning

Code cleaning #3

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 "action@github.com"
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 }}