ci: authenticate the checkout with the job token
This commit is contained in:
1 parent
390f72e53a
commit
a865553eae
1 file changed
+6
-2
@@ -14,8 +14,10 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
|
env:
|
||||||
|
TOKEN: ${{ github.token }}
|
||||||
run: |
|
run: |
|
||||||
git clone -q "http://gitea-http.gitea.svc.cluster.local:3000/${{ github.repository }}.git" src
|
git -c http.extraHeader="Authorization: token $TOKEN" clone -q "http://gitea-http.gitea.svc.cluster.local:3000/${{ github.repository }}.git" src
|
||||||
git -C src checkout -q "${{ github.sha }}"
|
git -C src checkout -q "${{ github.sha }}"
|
||||||
- name: Install dependencies and check the API
|
- name: Install dependencies and check the API
|
||||||
working-directory: src/api
|
working-directory: src/api
|
||||||
@@ -26,9 +28,11 @@ jobs:
|
|||||||
needs: test
|
needs: test
|
||||||
steps:
|
steps:
|
||||||
- name: Build images with Kaniko
|
- name: Build images with Kaniko
|
||||||
|
env:
|
||||||
|
TOKEN: ${{ github.token }}
|
||||||
run: |
|
run: |
|
||||||
set -eu
|
set -eu
|
||||||
git clone -q "http://gitea-http.gitea.svc.cluster.local:3000/${{ github.repository }}.git" src
|
git -c http.extraHeader="Authorization: token $TOKEN" clone -q "http://gitea-http.gitea.svc.cluster.local:3000/${{ github.repository }}.git" src
|
||||||
git -C src checkout -q "${{ github.sha }}"
|
git -C src checkout -q "${{ github.sha }}"
|
||||||
export SHA="${{ github.sha }}" RUN_ID="${{ github.run_id }}"
|
export SHA="${{ github.sha }}" RUN_ID="${{ github.run_id }}"
|
||||||
for pair in tamagotchi-api:api tamagotchi-frontend:frontend; do
|
for pair in tamagotchi-api:api tamagotchi-frontend:frontend; do
|
||||||
|
|||||||
Reference in new issue
Block a user