diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 976da344f656c85ef2179b08222d9be1228e36ab..68409454cde18650ed4e87977cf31ee8b0b626f4 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -167,6 +167,9 @@ jobs:
     runs-on: ubuntu-latest
     timeout-minutes: 15
 
+    permissions:
+      actions: write
+
     steps:
       - name: Checkout code
         uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
@@ -192,7 +195,8 @@ jobs:
           GH_TOKEN: ${{ github.token }}
           GH_REPO: ${{ github.event.repository.full_name }}
         run: |
-          gh api --method DELETE /repos/{owner}/{repo}/actions/caches?key=eslint-main-cache
+          gh api --method DELETE /repos/{owner}/{repo}/actions/caches?key=eslint-main-cache ||
+            echo "Cache not found"
 
       - name: Save eslint cache
         if: github.event_name == 'push'
@@ -206,6 +210,9 @@ jobs:
     runs-on: ubuntu-latest
     timeout-minutes: 7
 
+    permissions:
+      actions: write
+
     steps:
       - name: Checkout code
         uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
@@ -231,7 +238,8 @@ jobs:
           GH_TOKEN: ${{ github.token }}
           GH_REPO: ${{ github.event.repository.full_name }}
         run: |
-          gh api --method DELETE /repos/{owner}/{repo}/actions/caches?key=prettier-main-cache
+          gh api --method DELETE /repos/{owner}/{repo}/actions/caches?key=prettier-main-cache ||
+            echo "Cache not found"
 
       - name: Save prettier cache
         if: github.event_name == 'push'