Skip to content

Commit f7bb9f0

Browse files
committed
Only trigger container test workflow for changes in container build
Signed-off-by: Marcela Melara <marcela.melara@intel.com>
1 parent 19ea311 commit f7bb9f0

File tree

2 files changed

+19
-18
lines changed

2 files changed

+19
-18
lines changed
Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,34 @@
1+
# yamllint disable rule:line-length
12
name: Test for BuildEnv L1 container build
23

34
on:
45
push:
56
branches:
67
- main
8+
paths:
9+
- 'build-container/**'
710

811
permissions:
912
id-token: write
1013
attestations: write
1114
jobs:
1215
build:
13-
if: "contains(github.event.commits[0].message, '[test]')"
1416
runs-on: ubuntu-latest
1517

1618
steps:
17-
- name: Checkout
18-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 #v4.1.7
19+
- name: Checkout
20+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
21+
- name: Build docker container
22+
id: build
23+
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0
24+
with:
25+
context: "."
26+
file: "build-container/test-buildenv-l1.dockerfile"
27+
tags: "test_l1:latest"
1928

20-
- name: Build docker container
21-
id: build
22-
uses: actions/docker-build-push@5cd11c3a4ced054e52742c5fd54dca954e0edd85 #v6.7.0
23-
with:
24-
context: "."
25-
file: "build-container/test-buildenv-l1.dockerfile"
26-
tag: "test_l1:latest"
27-
28-
- name: Generate SLSA Provenance
29-
id: slsa
30-
uses: actions/attest-build-provenance@6149ea5740be74af77f260b9db67e633f6b0a9a1 #v1.4.2
31-
with:
32-
subject-name: "test_l1"
33-
subject-digest: ${{ steps.build.outputs.digest }}
29+
- name: Generate SLSA Provenance
30+
id: slsa
31+
uses: actions/attest-build-provenance@6149ea5740be74af77f260b9db67e633f6b0a9a1 # v1.4.2
32+
with:
33+
subject-name: "test_l1"
34+
subject-digest: ${{ steps.build.outputs.digest }}

build-container/hello.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This file is used fo testing measurements within containers
22

33
def hello():
4-
print('Hello, World.')
4+
print('Hello, World!!')
55

66
if __name__ == '__main__':
77
hello()

0 commit comments

Comments
 (0)