Skip to content

Commit d1360d0

Browse files
committed
[ci] fix project check
Signed-off-by: zhuangbowei.zbw <[email protected]>
1 parent 50b13b5 commit d1360d0

File tree

1 file changed

+47
-4
lines changed

1 file changed

+47
-4
lines changed

.github/workflows/project-checks.yml

+47-4
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,50 @@ jobs:
2525
path: src/github.com/containerd/overlaybd
2626
fetch-depth: 100
2727

28-
- name: Project checks
29-
uses: containerd/[email protected]
30-
with:
31-
working-directory: src/github.com/containerd/overlaybd
28+
- name: set env
29+
shell: bash
30+
run: |
31+
echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV
32+
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
33+
34+
- name: Install dependencies
35+
shell: bash
36+
env:
37+
GO111MODULE: on
38+
run: |
39+
echo "::group::🚧 Get dependencies"
40+
go install -v github.com/vbatts/git-validation@latest
41+
go install -v github.com/containerd/ltag@latest
42+
echo "::endgroup::"
43+
44+
- name: DCO Checks
45+
shell: bash
46+
working-directory: src/github.com/containerd/overlaybd
47+
env:
48+
GITHUB_COMMIT_URL: ${{ github.event.pull_request.commits_url }}
49+
REPO_ACCESS_TOKEN: ""
50+
DCO_VERBOSITY: "-v"
51+
DCO_RANGE: ""
52+
run: |
53+
echo "::group::👮 DCO checks"
54+
set -x
55+
if [[ ! -z "${REPO_ACCESS_TOKEN}" ]]; then
56+
HEADERS=(-H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${REPO_ACCESS_TOKEN}")
57+
else
58+
HEADERS=(-H "Accept: application/vnd.github+json")
59+
fi
60+
if [ -z "${GITHUB_COMMIT_URL}" ]; then
61+
DCO_RANGE=$(jq -r '.after + "..HEAD"' ${GITHUB_EVENT_PATH})
62+
else
63+
DCO_RANGE=$(curl "${HEADERS[@]}" ${GITHUB_COMMIT_URL} | jq -r '.[0].parents[0].sha + "..HEAD"')
64+
fi
65+
${{ github.action_path }}/script/validate/dco
66+
echo "::endgroup::"
67+
68+
- name: Validate file headers
69+
shell: bash
70+
working-directory: src/github.com/containerd/overlaybd
71+
run: |
72+
echo "::group::📚 File headers"
73+
${{ github.action_path }}/script/validate/fileheader ${{ github.action_path }}/
74+
echo "::endgroup::"

0 commit comments

Comments
 (0)