2525 - name : Checkout
2626 uses : actions/checkout@v4
2727 with :
28- fetch-depth : 2
28+ fetch-depth : 0 # Get full history
2929 ref : ${{ github.event.inputs.pr_number && format('refs/pull/{0}/merge', github.event.inputs.pr_number) || github.ref }}
3030
3131 - name : Set up Node
6060 steps :
6161 - uses : actions/checkout@v4
6262 with :
63- fetch-depth : 2
63+ fetch-depth : 0 # Get full history
6464 ref : ${{ github.event.inputs.pr_number && format('refs/pull/{0}/merge', github.event.inputs.pr_number) || github.ref }}
6565 - uses : actions/setup-node@v4
6666 with :
@@ -80,11 +80,25 @@ jobs:
8080 echo "hasCoverage=false" >> "$GITHUB_OUTPUT"
8181 fi
8282
83+ - name : Install 1Password CLI
84+ # v1
85+ uses : 1password/install-cli-action@143a85f84a90555d121cde2ff5872e393a47ab9f
86+
87+ - name : Load Codecov token from 1Password
88+ id : load-credentials
89+ # v2
90+ uses : 1password/load-secrets-action@581a835fb51b8e7ec56b71cf2ffddd7e68bb25e0
91+ with :
92+ export-env : false
93+ env :
94+ OP_SERVICE_ACCOUNT_TOKEN : ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
95+ CODECOV_TOKEN : op://${{ vars.OP_VAULT }}//CodeCov-API/key
96+
8397 - name : Upload Coverage to Codecov
8498 if : success() && steps.check-coverage.outputs.hasCoverage == 'true'
8599 uses : codecov/codecov-action@v5
86100 with :
87- token : ${{ secrets .CODECOV_TOKEN }}
101+ token : ${{ steps.load-credentials.outputs .CODECOV_TOKEN }}
88102 flags : shard-${{ matrix.shard }}
89103 override_pr : ${{ github.event.inputs.pr_number || '' }}
90104 override_commit : ${{ needs.setup.outputs.pr_sha || github.sha }}
@@ -104,7 +118,7 @@ jobs:
104118 if : ${{ steps.check-results.outputs.hasResults == 'true' }}
105119 uses : codecov/test-results-action@v1
106120 with :
107- token : ${{ secrets .CODECOV_TOKEN }}
121+ token : ${{ steps.load-credentials.outputs .CODECOV_TOKEN }}
108122 flags : shard-${{ matrix.shard }}
109123 override_pr : ${{ github.event.inputs.pr_number || '' }}
110124 override_commit : ${{ needs.setup.outputs.pr_sha || github.sha }}
0 commit comments