ruff-pre-commit/.github/workflows/main.yml
Subin Kim ba4269e9c6
feat: Update pre-commit mirror script (#53)
<!--
Thank you for contributing to Ruff! To help us out with reviewing,
please consider the following:

- Does this pull request include a summary of the change? (See below.)
- Does this pull request include a descriptive title?
- Does this pull request include references to any relevant issues?
-->

## Summary

<!-- What's the purpose of the change? What does it do, and why? -->

- `pre-commit-mirror-maker` is not suitable for generating multiple
hooks in single `.pre-commit-hooks.yaml` file.
- So replaced the script and github workflows.

## Test Plan

<!-- How was it tested? -->

- Update `pyproject.toml`'s `ruff==0.0.290` into `ruff==0.0.289`, and
run the script.

```sh
$ python3 mirror.py
...
```
2023-09-26 10:38:22 -05:00

37 lines
870 B
YAML

name: main
on:
schedule:
- cron: "0 */4 * * *"
workflow_dispatch:
repository_dispatch:
types: [pypi_release]
jobs:
build:
name: main
runs-on: ubuntu-latest
steps:
- if: ${{ startsWith(github.event_name, 'repository_dispatch') }}
run: sleep 30
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.11"
cache: pip
cache-dependency-path: requirements-dev.txt
- run: pip install -r requirements-dev.txt
- name: set git config
run: |
git config user.name 'Github Actions'
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'
- run: python mirror.py
- run: |
git push origin HEAD:refs/heads/main
git push origin HEAD:refs/heads/main --tags