瀏覽代碼

chore: add action to update preview dependencies

Shahed Nasser 1 年之前
父節點
當前提交
023632de23
共有 1 個文件被更改,包括 40 次插入0 次删除
  1. 40 0
      .github/update-preview-deps.yml

+ 40 - 0
.github/update-preview-deps.yml

@@ -0,0 +1,40 @@
+name: "Update Preview Dependencies"
+on:
+  schedule:
+    - cron: "0 */3 * * *" # every three hours
+  workflow_dispatch:
+
+jobs:
+  update:
+    runs-on: ubuntu-latest
+    steps:
+      - name: Cancel Previous Runs
+        uses: styfle/cancel-workflow-action@0.9.1
+        with:
+          access_token: ${{ github.token }}
+
+      - name: Checkout
+        uses: actions/checkout@v2.3.5
+          ref: 'feat/v2'
+
+      - name: Setup Node.js 18.x
+        uses: actions/setup-node@v2
+        with:
+          node-version: 18.x
+
+      - name: Remove yarn.lock
+        run: rm yarn.lock
+
+      - name: Install Dependencies
+        run: yarn
+
+      - name: Open PR with changes
+        uses: peter-evans/create-pull-request@v5
+        env:
+          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+        with:
+          title: "chore: updated preview dependencies"
+          body: "This PR updates preview dependencies to the latest versions."
+          branch: "chore/update-preview"
+          base: "feat/v2"
+          add-paths: yarn.lock