diff --git a/.github/workflows/test-action.yaml b/.github/workflows/test-action.yaml index a106294..993e918 100644 --- a/.github/workflows/test-action.yaml +++ b/.github/workflows/test-action.yaml @@ -3,6 +3,8 @@ name: Test Log4shell cpatch Action on: push: branches: ['main'] + pull_request: + branches: ['main'] jobs: use-action: @@ -15,6 +17,7 @@ jobs: - uses: engineerd/setup-kind@v0.5.0 with: version: "v0.11.1" + config: tekton/kind-config.yaml - name: Install Tekton Pipelines run: kubectl apply -f https://storage.googleapis.com/tekton-releases/pipeline/previous/v0.24.1/release.yaml @@ -22,11 +25,11 @@ jobs: - uses: jerop/tkn@v0.1.0 - name: Test non-vulnerable image - uses: mgreau/log4shell-cpatch@main + uses: mgreau/log4shell-cpatch with: image: alpine - name: Test vulnerable image - uses: mgreau/log4shell-cpatch@main + uses: mgreau/log4shell-cpatch with: image: mlinarik/log4j-log4shell-vulnerable-app:latest diff --git a/action.yaml b/action.yaml index 50b5c65..5c032d4 100644 --- a/action.yaml +++ b/action.yaml @@ -31,3 +31,8 @@ runs: PR=$(tkn pipelinerun list -o name --limit 1) PR_NAME=$(echo "${PR#*/}") tkn pipelinerun describe ${PR_NAME} + + - uses: actions/upload-artifact@v2 + with: + name: my-artifact + path: /tmp/ \ No newline at end of file diff --git a/tekton/kind-config.yaml b/tekton/kind-config.yaml new file mode 100644 index 0000000..5e0c222 --- /dev/null +++ b/tekton/kind-config.yaml @@ -0,0 +1,7 @@ +apiVersion: kind.x-k8s.io/v1alpha4 +kind: Cluster +nodes: +- role: control-plane + extraMounts: + - hostPath: /tmp/ + containerPath: /ws/ \ No newline at end of file diff --git a/tekton/pvc.yaml b/tekton/pvc.yaml index 61b45a7..4dbe1b9 100644 --- a/tekton/pvc.yaml +++ b/tekton/pvc.yaml @@ -1,8 +1,23 @@ +--- +apiVersion: v1 +kind: PersistentVolume +metadata: + name: pv +spec: + storageClassName: standard + accessModes: + - ReadWriteOnce + capacity: + storage: 2Gi + hostPath: + path: /ws/ +--- apiVersion: v1 kind: PersistentVolumeClaim metadata: name: pvc spec: + volumeName: pv accessModes: - ReadWriteOnce resources: