Explorar el Código

ci: replace custom token with built-in github.token

Signed-off-by: Ahmed Al-Nassif <mr.ahmed.nassif@gmail.com>
Ahmed Al-Nassif hace 2 semanas
padre
commit
02d5749a1e

+ 3 - 3
.github/actions/fetch-root-managers/action.yml

@@ -43,7 +43,7 @@ runs:
         RUN_ID="${{ inputs.run_id }}"
         WANT="${{ inputs.want }}"
         OUT_ABS="${{ inputs.output_dir }}"
-        TOKEN="${{ inputs.token }}"
+        GH_TOKEN="${{ inputs.token }}"
         mkdir -p "$OUT_ABS" manager-dl
         (
           cd manager-dl
@@ -59,7 +59,7 @@ runs:
           else
             echo "Downloading $REPO manager from run $RUN_ID"
             ARTIFACTS_JSON=$(curl -fsSL --retry 5 --retry-delay 5 --retry-all-errors \
-              -H "Authorization: Bearer $TOKEN" \
+              -H "Authorization: Bearer $GH_TOKEN" \
               "https://api.github.com/repos/${OWNER}/${REPO}/actions/runs/${RUN_ID}/artifacts")
             if [ -z "$WANT" ]; then
               ARTIFACT_IDS=$(echo "$ARTIFACTS_JSON" | jq -r '.artifacts[].id')
@@ -71,7 +71,7 @@ runs:
             echo "$ARTIFACT_IDS" | while read -r AID; do
               [ -n "$AID" ] || continue
               curl -fsSL --retry 5 --retry-delay 5 --retry-all-errors \
-                -H "Authorization: Bearer $TOKEN" \
+                -H "Authorization: Bearer $GH_TOKEN" \
                 -o "_${AID}.zip" \
                 "https://api.github.com/repos/${OWNER}/${REPO}/actions/artifacts/${AID}/zip"
               mkdir -p "_${AID}"

+ 2 - 2
.github/workflows/build.yml

@@ -487,7 +487,7 @@ jobs:
         cache_key: ${{ inputs.android_version }}-${{ inputs.kernel_version }}.${{ steps.extract.outputs.sublevel }}-${{ inputs.os_patch_level }}
         cache_bucket: "ccache-cache"
         compression_level: 9
-        github_token: ${{ secrets.MY_GITHUB_TOKEN }}
+        github_token: ${{ github.token }}
 
     - name: Save bazel-cache
       continue-on-error: true
@@ -498,7 +498,7 @@ jobs:
         cache_key: ${{ inputs.android_version }}-${{ inputs.kernel_version }}.${{ steps.extract.outputs.sublevel }}-${{ inputs.os_patch_level }}
         cache_bucket: "bazel-cache"
         compression_level: 9
-        github_token: ${{ secrets.MY_GITHUB_TOKEN }}
+        github_token: ${{ github.token }}
 
     - name: Build Bypass Kernel
       if: false

+ 5 - 5
.github/workflows/main.yml

@@ -339,7 +339,7 @@ jobs:
                 # Manager is built from the official dev-tip commit (grabbed at run start).
                 stock="${{ steps.resolve.outputs.kernelsu_commit }}"
                 run_id=$(curl -fsSL --retry 5 --retry-delay 5 --retry-all-errors \
-                  -H "Authorization: Bearer ${{ secrets.MY_GITHUB_TOKEN }}" \
+                  -H "Authorization: Bearer ${{ github.token }}" \
                   "https://api.github.com/repos/${owner}/${repo}/actions/workflows/${wf}/runs?head_sha=${stock}" \
                   | jq -r '.workflow_runs[0].id // empty')
                 if [[ -z "${run_id}" ]]; then
@@ -455,7 +455,7 @@ jobs:
         shell: bash
         env:
           MANAGER_LIST: ${{ needs.resolve-sources.outputs.manager_list }}
-          TOKEN: ${{ secrets.MY_GITHUB_TOKEN }}
+          GH_TOKEN: ${{ github.token }}
         run: |
           set -euo pipefail
           OUT_APKS="${GITHUB_WORKSPACE:-$PWD}/manager_apks"
@@ -484,7 +484,7 @@ jobs:
                 done
               else
                 AJSON=$(curl -fsSL --retry 5 --retry-delay 5 --retry-all-errors \
-                  -H "Authorization: Bearer ${TOKEN}" \
+                  -H "Authorization: Bearer ${GH_TOKEN}" \
                   "https://api.github.com/repos/${OWNER}/${REPO}/actions/runs/${RUN_ID}/artifacts")
                 if [ -z "$WANT" ]; then
                   ART_IDS=$(echo "$AJSON" | jq -r '.artifacts[].id')
@@ -496,7 +496,7 @@ jobs:
                 echo "$ART_IDS" | while read -r AID; do
                   [ -n "$AID" ] || continue
                   curl -fsSL --retry 5 --retry-delay 5 --retry-all-errors \
-                    -H "Authorization: Bearer ${TOKEN}" \
+                    -H "Authorization: Bearer ${GH_TOKEN}" \
                     -o "_${AID}.zip" \
                     "https://api.github.com/repos/${OWNER}/${REPO}/actions/artifacts/${AID}/zip"
                   mkdir -p "_${AID}"
@@ -814,7 +814,7 @@ jobs:
     - uses: actions/checkout@v7
       with:
         ref: ${{ github.ref }}
-        token: ${{ secrets.GITHUB_TOKEN }}
+        token: ${{ github.token }}
 
     - name: Promote verified pins on success
       id: promote