Time: 1 ms (95.81%), Space: 17.9 MB (25.52%) - LeetHub #769
This file contains hidden or 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: LeetHub Supports | |
on: | |
push: | |
branches: | |
- "main" | |
jobs: | |
leethub_support: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
persist-credentials: false | |
fetch-depth: 0 | |
- name: Move questions to leetcode directory | |
run: python3 .github/workflows/scripts/leethub_support.py | |
- name: Format python answers | |
run: | | |
python3 -m pip install --upgrade pip | |
pip install ruff | |
ruff format **/*.py | |
- name: Format go answers | |
run: .github/workflows/scripts/go_handler.sh | |
- name: Remove empty files | |
run: find ./leetcode -size -4c -print -delete | |
- name: Commit files | |
run: | | |
git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
git add -A | |
git commit --amend -C HEAD | |
- name: Merge commits authored today | |
run: .github/workflows/scripts/merge_commits.sh | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: ${{ github.ref }} | |
force: true |