fix: replace actions/checkout with plain git clone in CI
actions/checkout@v4 is a JS action that needs node in the job container to run, but the buf and golang job containers don't ship Node.js — caused "exec: node: executable file not found" failures.
This commit is contained in:
@@ -10,9 +10,15 @@ jobs:
|
|||||||
container:
|
container:
|
||||||
image: bufbuild/buf:latest
|
image: bufbuild/buf:latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
# actions/checkout@v4 is a JS action — it needs `node` inside the job's
|
||||||
with:
|
# container to run, but bufbuild/buf has no Node.js. Plain git clone has
|
||||||
fetch-depth: 0
|
# no such dependency and works in any image.
|
||||||
|
- name: checkout
|
||||||
|
env:
|
||||||
|
GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: |
|
||||||
|
git clone "https://x-access-token:${GIT_TOKEN}@${GITHUB_SERVER_URL#https://}/${GITHUB_REPOSITORY}.git" .
|
||||||
|
git checkout "${GITHUB_SHA}"
|
||||||
|
|
||||||
- name: buf lint
|
- name: buf lint
|
||||||
run: buf lint
|
run: buf lint
|
||||||
@@ -26,7 +32,14 @@ jobs:
|
|||||||
container:
|
container:
|
||||||
image: golang:1.25
|
image: golang:1.25
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
# Same reason as the buf job: golang:1.25 has no Node.js, so the JS
|
||||||
|
# action actions/checkout@v4 can't run here — plain git clone instead.
|
||||||
|
- name: checkout
|
||||||
|
env:
|
||||||
|
GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: |
|
||||||
|
git clone "https://x-access-token:${GIT_TOKEN}@${GITHUB_SERVER_URL#https://}/${GITHUB_REPOSITORY}.git" .
|
||||||
|
git checkout "${GITHUB_SHA}"
|
||||||
|
|
||||||
- name: Install buf and protoc plugins
|
- name: Install buf and protoc plugins
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
Reference in New Issue
Block a user