summaryrefslogtreecommitdiffstats
path: root/.github
diff options
context:
space:
mode:
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/update.yml66
1 files changed, 66 insertions, 0 deletions
diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml
new file mode 100644
index 0000000..053878e
--- /dev/null
+++ b/.github/workflows/update.yml
@@ -0,0 +1,66 @@
+name: Update Extensions
+
+on:
+ schedule:
+ - cron: '0 */4 * * *'
+ workflow_dispatch:
+ push:
+ branches:
+ - main
+
+permissions:
+ contents: write
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: false
+
+jobs:
+ update:
+ runs-on: ubuntu-latest
+ if: github.event_name != 'push' || github.event.head_commit.author.name != 'github-actions[bot]'
+ outputs:
+ updated: ${{ steps.update.outputs.updated }}
+
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
+
+ - name: Install bun
+ uses: oven-sh/setup-bun@735343b667d3e6f658f44d0eca948eb6282f2b76 # v2.0.2
+ with:
+ bun-version: latest
+
+ - name: Install dependencies
+ run: bun install --frozen-lockfile
+
+ - name: Update extensions (quick)
+ id: update
+ run: bun run update --quick
+
+ - name: Commit and push changes
+ if: steps.update.outputs.updated == 'true'
+ run: |
+ git config --local user.name "github-actions[bot]"
+ git config --local user.email "github-actions[bot]@users.noreply.github.com"
+ git add extensions.json
+ git diff-index --quiet HEAD || git commit -m "chore: update extensions.json"
+ git push
+
+ sync-to-gitlab:
+ runs-on: ubuntu-latest
+ needs: update
+ if: needs.update.outputs.updated == 'true' || github.event_name == 'workflow_dispatch'
+
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
+ with:
+ ref: main
+ fetch-depth: 0
+
+ - name: Sync to GitLab
+ uses: pixta-dev/repository-mirroring-action@674e65a7d483ca28dafaacba0d07351bdcc8bd75 # v1.1.1
+ with:
+ target_repo_url: ${{ secrets.GITLAB_REPO }}
+ ssh_private_key: ${{ secrets.GITLAB_SSH }}