Skip to content

Commit

Permalink
CI: prevent remote code execution through github action
Browse files Browse the repository at this point in the history
Signed-off-by: zhuangbowei.zbw <[email protected]>
  • Loading branch information
WaberZhuang committed Jul 26, 2024
1 parent 3807312 commit c6bc65b
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 28 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/ci-unit-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Unit Test
on:
push:
branches:
- main
pull_request:
branches:
- 'main'

jobs:
unit-test:
name: Unit Test
runs-on: ubuntu-22.04
timeout-minutes: 10

steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
path: src/github.com/containerd/accelerated-container-image
fetch-depth: 100

- name: install Go
uses: actions/setup-go@v5
with:
go-version: '1.22.0'

- name: set env
shell: bash
run: |
echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
- name: unit test
working-directory: src/github.com/containerd/accelerated-container-image
run: |
sudo GO_TESTFLAGS=-v make test
28 changes: 0 additions & 28 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,34 +17,6 @@ on:
- labeled

jobs:
unit-test:
name: Unit Test
runs-on: ubuntu-22.04
timeout-minutes: 10

steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
path: src/github.com/containerd/accelerated-container-image
fetch-depth: 100

- name: install Go
uses: actions/setup-go@v5
with:
go-version: '1.22.0'

- name: set env
shell: bash
run: |
echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
- name: unit test
working-directory: src/github.com/containerd/accelerated-container-image
run: |
sudo GO_TESTFLAGS=-v make test
lowercase-repo:
name: Lowercase Repo
runs-on: ubuntu-22.04
Expand Down

0 comments on commit c6bc65b

Please sign in to comment.