forked from psf/black-pre-commit-mirror
-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (35 loc) · 976 Bytes
/
mirror.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: Mirror
on:
push:
branches: [main]
workflow_dispatch:
schedule:
- cron: "0 12 * * *"
jobs:
build:
permissions:
contents: write
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 }}