Skip to content

Commit 0f22718

Browse files
authored
Merge pull request #293 from WaberZhuang/main
CI: prevent remote code execution through github action
2 parents 3807312 + 4918eb7 commit 0f22718

File tree

2 files changed

+36
-28
lines changed

2 files changed

+36
-28
lines changed

.github/workflows/ci-unit-test.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Unit Test
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
branches:
8+
- 'main'
9+
10+
jobs:
11+
unit-test:
12+
name: Unit Test
13+
runs-on: ubuntu-22.04
14+
timeout-minutes: 10
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
with:
19+
path: src/github.com/containerd/accelerated-container-image
20+
fetch-depth: 100
21+
22+
- name: install Go
23+
uses: actions/setup-go@v5
24+
with:
25+
go-version: '1.22.0'
26+
27+
- name: set env
28+
shell: bash
29+
run: |
30+
echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV
31+
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
32+
33+
- name: unit test
34+
working-directory: src/github.com/containerd/accelerated-container-image
35+
run: |
36+
sudo GO_TESTFLAGS=-v make test

.github/workflows/ci.yml

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -17,34 +17,6 @@ on:
1717
- labeled
1818

1919
jobs:
20-
unit-test:
21-
name: Unit Test
22-
runs-on: ubuntu-22.04
23-
timeout-minutes: 10
24-
25-
steps:
26-
- uses: actions/checkout@v4
27-
with:
28-
ref: ${{ github.event.pull_request.head.sha || github.sha }}
29-
path: src/github.com/containerd/accelerated-container-image
30-
fetch-depth: 100
31-
32-
- name: install Go
33-
uses: actions/setup-go@v5
34-
with:
35-
go-version: '1.22.0'
36-
37-
- name: set env
38-
shell: bash
39-
run: |
40-
echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV
41-
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
42-
43-
- name: unit test
44-
working-directory: src/github.com/containerd/accelerated-container-image
45-
run: |
46-
sudo GO_TESTFLAGS=-v make test
47-
4820
lowercase-repo:
4921
name: Lowercase Repo
5022
runs-on: ubuntu-22.04

0 commit comments

Comments
 (0)