Parcourir la source

Merge branch 'master' into v2

Oli Juhl il y a 8 mois
Parent
commit
9b8680d50b

+ 14 - 11
.github/workflows/update-preview-deps-ci.yml

@@ -32,19 +32,22 @@ jobs:
       - name: Close Previous PRs
         shell: "bash"
         run: |
-          # Get the list of pull requests with the specified title
-          PR_LIST=$(gh pr list --base feat/v2-ci --json number)
-          
-          echo "$PR_LIST"
-          
-          # Check if any pull requests were found
-          if [ -z "$PR_LIST" ]; then
-            echo "No pull requests found on branch feat/v2-ci"
+
+          PR_LIST=$(gh pr list --base feat/v2-ci --json number,headRefName)
+
+          # Filter out PRs where headRefName starts with 'chore/update-preview'
+          FILTERED_PR_LIST=$(echo "$PR_LIST" | jq '[.[] | select(.headRefName | test("^chore/update-preview"))]')
+
+          echo "$FILTERED_PR_LIST"
+
+          # Check if any pull requests were found after filtering
+          if [ -z "$FILTERED_PR_LIST" ] || [ "$FILTERED_PR_LIST" = "[]" ]; then
+            echo "No pull requests found on branch feat/v2-ci after filtering"
             exit 0
           fi
-          
-          # Close each pull request
-          echo "$PR_LIST" | jq -r '.[].number' | while read -r PR_NUMBER; do
+
+          # Close each filtered pull request
+          echo "$FILTERED_PR_LIST" | jq -r '.[].number' | while read -r PR_NUMBER; do
             echo "Closing pull request #$PR_NUMBER"
             gh pr close "$PR_NUMBER" -d
           done

+ 15 - 14
.github/workflows/update-preview-deps.yml

@@ -1,7 +1,5 @@
 name: "Update Preview Dependencies (feat/v2)"
 on:
-  schedule:
-    - cron: "15 */3 * * *" # every three hours
   workflow_dispatch:
 
 jobs:
@@ -32,19 +30,22 @@ jobs:
       - name: Close Previous PRs
         shell: "bash"
         run: |
-          # Get the list of pull requests with the specified title
-          PR_LIST=$(gh pr list --base feat/v2 --json number)
-          
-          echo "$PR_LIST"
-          
-          # Check if any pull requests were found
-          if [ -z "$PR_LIST" ]; then
-            echo "No pull requests found on branch feat/v2"
+
+          PR_LIST=$(gh pr list --base feat/v2 --json number,headRefName)
+
+          # Filter out PRs where headRefName starts with 'chore/update-preview'
+          FILTERED_PR_LIST=$(echo "$PR_LIST" | jq '[.[] | select(.headRefName | test("^chore/update-preview"))]')
+
+          echo "$FILTERED_PR_LIST"
+
+          # Check if any pull requests were found after filtering
+          if [ -z "$FILTERED_PR_LIST" ] || [ "$FILTERED_PR_LIST" = "[]" ]; then
+            echo "No pull requests found on branch feat/v2 after filtering"
             exit 0
           fi
-          
-          # Close each pull request
-          echo "$PR_LIST" | jq -r '.[].number' | while read -r PR_NUMBER; do
+
+          # Close each filtered pull request
+          echo "$FILTERED_PR_LIST" | jq -r '.[].number' | while read -r PR_NUMBER; do
             echo "Closing pull request #$PR_NUMBER"
             gh pr close "$PR_NUMBER" -d
           done
@@ -65,4 +66,4 @@ jobs:
           base: "feat/v2"
           add-paths: yarn.lock
           committer: "GitHub <noreply@github.com>"
-          author: "GitHub <github-actions[bot]@users.noreply.github.com>"
+          author: "GitHub <github-actions[bot]@users.noreply.github.com>"