Skip to content

Commit f617507

Browse files
authored
Add custom commands to .NET quality workflow (#8)
* Fix typo between secrets and inputs * Add custom-commands input to reusable-dotnet-quality.yml
1 parent 66ea6a2 commit f617507

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

.github/workflows/reusable-container-publication.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ jobs:
108108
username: ${{ secrets.container-registry-username }}
109109
password: ${{ secrets.container-registry-password }}
110110
- name: Build container image
111-
run: docker build . --file ${{ inputs.image-definition }} --tag ${{ env.IMAGE_REF }} ${{ secrets.extra-build-arguments }}
111+
run: docker build . --file ${{ inputs.image-definition }} --tag ${{ env.IMAGE_REF }} ${{ inputs.extra-build-arguments }}
112112
shell: bash
113113
- name: Generate SBOM with Syft
114114
uses: anchore/sbom-action@v0

.github/workflows/reusable-dotnet-quality.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ name: Reusable - .NET quality
33
on:
44
workflow_call:
55
inputs:
6+
custom-commands:
7+
description: "Optional shell commands to run before build & test"
8+
type: string
9+
required: false
10+
default: ""
611
dotnet-version:
712
description: .NET version
813
type: string
@@ -107,6 +112,10 @@ jobs:
107112
- name: Start MongoDB
108113
if: ${{ inputs.mongodb-enabled }}
109114
uses: ./workflow-parts/actions/mongodb/start
115+
- name: Run optional custom commands
116+
if: ${{ inputs.custom-commands != '' }}
117+
run: |
118+
${{ inputs.custom-commands }}
110119
- name: Build & test
111120
if: ${{ ! inputs.sonar-enabled }}
112121
uses: ./workflow-parts/actions/dotnet/build-test

0 commit comments

Comments
 (0)