Skip to content

Commit e973a45

Browse files
[WIP] Move SBOM merge to function
1 parent be3ba94 commit e973a45

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

.github/workflows/sbom.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
with:
5050
node-version-file: "package.json"
5151

52-
- name: "Nextcloud: install npm dependencies"
52+
- name: "Install dependencies (Nextcloud - npm)"
5353
env:
5454
FONTAWESOME_PACKAGE_TOKEN: ${{ secrets.FONTAWESOME_PACKAGE_TOKEN }}
5555
run: |
@@ -113,10 +113,12 @@ jobs:
113113
# elements or values that prevent upload to Dependency Track.
114114
run: |
115115
echo "Merge BOMs for: Nextcloud"
116-
cyclonedx merge --input-files bom.nextcloud.composer.xml bom.nextcloud.npm.xml --output-file bom.xml --output-version v1_3
117-
awk '/^ <metadata>/ { ignore=1 } /^ <\/metadata>/ { ignore=0; next; } { if (!ignore) print }' bom.xml >bom.nextcloud.xml
116+
function merge_bom() {
117+
cyclonedx merge --input-files bom.${1}.composer.xml bom.${1}.npm.xml --output-file bom.xml --output-version v1_3 ;
118+
awk '/^ <metadata>/ { ignore=1 } /^ <\/metadata>/ { ignore=0; next; } { if (!ignore) print }' bom.xml >bom.${1}.xml ;
119+
}
118120
119-
# TODO use for loop where needed for apps
121+
merge_bom "nextcloud"
120122
121123
- name: Show BOMs
122124
run: |

0 commit comments

Comments
 (0)