chore(deps): update astral-sh/setup-uv action to v5 #22
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: fix | |
on: | |
pull_request: | |
types: [opened, synchronize, reopened] | |
paths: | |
- "**.json" | |
- "scripts/fix.py" | |
- ".github/workflows/fix.yml" | |
defaults: | |
run: | |
shell: bash -e {0} | |
permissions: | |
contents: write | |
jobs: | |
fix: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: astral-sh/setup-uv@v5 | |
with: | |
version: "0.5.9" | |
enable-cache: true | |
- name: Set up Python | |
run: uv python install 3.13 | |
- name: Install the project | |
run: uv sync --all-extras --dev | |
- name: Fix the json file | |
run: uv run scripts/fix.py | |
- name: Render markdown files | |
run: uv run scripts/json2md.py | |
- name: Configure Git | |
run: | | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
- name: Check for changes | |
id: git_diff | |
run: | | |
git diff --exit-code || echo "has_changed=true" >> $GITHUB_OUTPUT | |
- name: Commit changes | |
if: ${{ steps.git_diff.outputs.has_changed == 'true' }} | |
run: | | |
git add . | |
git commit -m "fix: auto fix json file" | |
git pull --rebase origin ${{ github.head_ref }} | |
git push origin HEAD:${{ github.head_ref }} | |
- name: Push changes | |
if: ${{ steps.git_diff.outputs.has_changed == 'true' }} | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: ${{ github.head_ref }} |