kiddin9 3 年之前
父節點
當前提交
4e3f2b366f
共有 1 個文件被更改,包括 12 次插入0 次删除
  1. 12 0
      .github/workflows/repo-dispatcher.yml

+ 12 - 0
.github/workflows/repo-dispatcher.yml

@@ -48,6 +48,18 @@ jobs:
         echo "REPO_URL=${REPO_URL}" >> $GITHUB_ENV
         echo "REPO_BRANCH=${REPO_BRANCH}" >> $GITHUB_ENV
 
+    - name: Trigger Packages Update
+      run: |
+        gitdate=$(curl -H "Authorization: token ${{ secrets.REPO_TOKEN }}" -s "https://api.github.com/repos/kiddin9/openwrt-packages/actions/runs" | jq -r '.workflow_runs[0].created_at')
+        gitdate=$(date -d "$gitdate" +%s)
+        now=$(date -d "$(date)" +%s)
+        if [[ $(expr $gitdate + 120) < $now ]]; then
+        curl -X POST https://api.github.com/repos/kiddin9/openwrt-packages/dispatches \
+        -H "Accept: application/vnd.github.everest-preview+json" \
+        -H "Authorization: token ${{ secrets.REPO_TOKEN }}" \
+        --data '{"event_type": "update"}'
+        fi
+
     - name: Trigger Compile
       run: |
         sudo timedatectl set-timezone "$TZ"