Skip to content

Commit

Permalink
improve workflows for multi package strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
ReneWerner87 committed Jan 15, 2024
1 parent ea00cb3 commit 555417e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,10 @@ jobs:
- name: Fetch Repository
uses: actions/checkout@v4
- name: Generate Matrix
working-directory: .
id: generate-matrix
run: |
SUBDIRS=$(find . -maxdepth 1 -type d -not -name '.*' -not -name 'internal' | sed 's|./||' | tr '\n' ' ')
JSON_MATRIX=$(echo "$SUBDIRS" | jq -R -c -s 'split(" ")')
SUBDIRS=$(find . -maxdepth 1 -type d -not -name '.*' -not -name 'internal' -not -empty | sed 's|./||' | tr '\n' ' ' | sed 's/ $//')
JSON_MATRIX=$(echo "$SUBDIRS" | jq -R -c -s 'split(" ") | map(select(. != "")) | .[-1] |= sub("\n$"; "")')
echo "::set-output name=matrix::$JSON_MATRIX"
shell: bash

Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/gosec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,10 @@ jobs:
- name: Fetch Repository
uses: actions/checkout@v4
- name: Generate Matrix
working-directory: .
id: generate-matrix
run: |
SUBDIRS=$(find . -maxdepth 1 -type d -not -name '.*' -not -name 'internal' | sed 's|./||' | tr '\n' ' ')
JSON_MATRIX=$(echo "$SUBDIRS" | jq -R -c -s 'split(" ")')
SUBDIRS=$(find . -maxdepth 1 -type d -not -name '.*' -not -name 'internal' -not -empty | sed 's|./||' | tr '\n' ' ' | sed 's/ $//')
JSON_MATRIX=$(echo "$SUBDIRS" | jq -R -c -s 'split(" ") | map(select(. != "")) | .[-1] |= sub("\n$"; "")')
echo "::set-output name=matrix::$JSON_MATRIX"
shell: bash

Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/govulncheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,11 @@ jobs:
- name: Fetch Repository
uses: actions/checkout@v4
- name: Generate Matrix
working-directory: .
id: generate-matrix
run: |
SUBDIRS=$(find . -maxdepth 1 -type d -not -name '.*' -not -name 'internal' | sed 's|./||' | tr '\n' ' ')
JSON_MATRIX=$(echo "$SUBDIRS" | jq -R -c -s 'split(" ")')
echo "::set-output name=matrix::$JSON_MATRIX"
SUBDIRS=$(find . -maxdepth 1 -type d -not -name '.*' -not -name 'internal' -not -empty | sed 's|./||' | tr '\n' ' ' | sed 's/ $//')
JSON_MATRIX=$(echo "$SUBDIRS" | jq -R -c -s 'split(" ") | map(select(. != "")) | .[-1] |= sub("\n$"; "")')
echo "::set-output name=matrix::$JSON_MATRIX"
shell: bash

govulncheck-check:
Expand Down

0 comments on commit 555417e

Please sign in to comment.