forked from psf/black-pre-commit-mirror
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
π· ci: add workflow to auto sync latest version (#1)
- Loading branch information
Showing
2 changed files
with
55 additions
and
7 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Mirror | ||
on: | ||
push: | ||
branches: [main] | ||
workflow_dispatch: | ||
schedule: | ||
- cron: "0 12 * * *" | ||
|
||
jobs: | ||
build: | ||
name: Mirror | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install uv | ||
uses: astral-sh/setup-uv@v5 | ||
|
||
- name: Install python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.13" | ||
|
||
- name: Setup git | ||
run: | | ||
git config --global user.name 'Github Actions' | ||
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com' | ||
- name: Run mirror | ||
run: | | ||
uv run --script mirror.py | ||
- name: Push changes | ||
run: | | ||
git remote set-url origin https://x-access-token:[email protected]/$GITHUB_REPOSITORY | ||
git push origin HEAD:refs/heads/main --tags | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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