~samwhited/otp

de357eb5b8e9d859853997c7b52f2410acf57b92 — Sam Whited 9 months ago f8943f7 master
.github: auto close PRs and mirror from SourceHut
2 files changed, 30 insertions(+), 0 deletions(-)

A .github/workflows/mirror.yml
A .github/workflows/pr.yml
A .github/workflows/mirror.yml => .github/workflows/mirror.yml +18 -0
@@ 0,0 1,18 @@
name: Mirror Repo
on:
  schedule:
    # Backup nightly
    - cron:  '0 0 * * *'

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - name: Mirror
      run: |
        git clone --mirror 'https://git.sr.ht/~samwhited/otp' repo
        cd repo/
        git remote add github "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$GITHUB_REPOSITORY.git"
        git push --mirror github
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

A .github/workflows/pr.yml => .github/workflows/pr.yml +12 -0
@@ 0,0 1,12 @@
name: PR Closer
on: [pull_request]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - name: Auto Close
      uses: superbrothers/auto-close-action@v0.0.1
      env:
        COMMENT: This repo is a mirror and does not accept PRs. See `README.md` and `CONTRIBUTING.md` for more information. Thanks for submitting a patch!
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}