From 3127758e8b97cbf06381c9ae0867ca53316eca15 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Sat, 14 Dec 2024 00:06:45 +0000 Subject: [PATCH] ci: override workflows --- .github/workflows/mirror.yaml | 60 +++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 .github/workflows/mirror.yaml diff --git a/.github/workflows/mirror.yaml b/.github/workflows/mirror.yaml new file mode 100644 index 0000000..504fcf5 --- /dev/null +++ b/.github/workflows/mirror.yaml @@ -0,0 +1,60 @@ +name: Mirror from declaratia + +permissions: write-all + +on: + schedule: + - cron: "0 0 * * *" + workflow_dispatch: + +jobs: + sync: + runs-on: ubuntu-latest + + steps: + - run: | + git config --global user.name 'GitHub Action' + git config --global user.email 'action@github.com' + + - uses: actions/setup-python@v5 + with: + python-version: "3.13" + + - uses: actions/checkout@v3 + with: + repository: newren/git-filter-repo + path: git-filter-repo + + - uses: actions/checkout@v3 + with: + repository: merrkry/declaratia + fetch-depth: 0 + path: declaratia + ref: master + token: ${{ secrets.PAT }} + + - uses: actions/checkout@v3 + with: + repository: merrkry/decalratia + path: decalratia + ref: master + + - run: | + cd declaratia + python ../git-filter-repo/git-filter-repo --path flake.lock --invert-paths --force + + - run: | + rm -rf declaratia/.github/workflows + mkdir -p declaratia/.github/workflows + cp -r decalratia/.github/workflows/* declaratia/.github/workflows/ + cd declaratia + git add .github/workflows + git commit -m "ci: override workflows" + + - uses: ad-m/github-push-action@master + with: + branch: master + force: true + directory: declaratia + repository: merrkry/decalratia + github_token: ${{ secrets.PAT }}