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: Lint Code Base | |
on: | |
push: | |
branches: ["hyde-gallery"] | |
pull_request: | |
branches: ["hyde-gallery"] | |
jobs: | |
run-lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Lint Code Base | |
uses: github/super-linter@v4 | |
env: | |
VALIDATE_ALL_CODEBASE: false | |
VALIDATE_PYTHON: false | |
VALIDATE_JSON: true | |
DEFAULT_BRANCH: "hyde-gallery" | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.x" # Specify the Python version you need | |
- name: Run generate_readme.py | |
run: python generate_readme.py # Run the script from the root directory | |
- name: Check for README changes | |
id: check_changes | |
run: | | |
git fetch origin hyde-gallery | |
git diff --exit-code README.md || echo "README has changed" | |
- name: Commit and push changes | |
if: steps.check_changes.outputs.README_has_changed == 'README has changed' | |
run: | | |
git config --local user.name "GitHub Action" | |
git config --local user.email "action@github.com" | |
git checkout -b update-readme-branch | |
git add README.md | |
git commit -m "Update README from GitHub Actions" | |
git push origin update-readme-branch | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create Pull Request | |
if: steps.check_changes.outputs.README_has_changed == 'README has changed' | |
uses: peter-evans/create-pull-request@v4 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
commit-message: "Update README from GitHub Actions" | |
branch: update-readme-branch | |
title: "Update README" | |
body: "This PR updates the README file." |