-
Notifications
You must be signed in to change notification settings - Fork 27
Modify govulncheck to only check cwagent components and fix lint issues #316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
3d8c04a
5e24066
d14e0b8
a9d85cc
ff02dfc
de1669c
e5976c1
ab13cdd
7b59597
783eb00
38cd1d0
19fc8bf
2f83dbb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -141,25 +141,24 @@ jobs: | |
fail-fast: false | ||
matrix: | ||
group: | ||
- receiver-0 | ||
- receiver-1 | ||
- receiver-2 | ||
- receiver-3 | ||
- processor-0 | ||
- processor-1 | ||
- exporter-0 | ||
- exporter-1 | ||
- exporter-2 | ||
- exporter-3 | ||
- extension | ||
- connector | ||
- internal | ||
- pkg | ||
- cmd-0 | ||
- cmd-1 | ||
- cwagent | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
steps: | ||
- name: Checkout CloudWatch Agent Repo | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: aws/amazon-cloudwatch-agent | ||
path: 'amazon-cloudwatch-agent' | ||
sparse-checkout: go.mod | ||
- name: Get Components | ||
id: get-components | ||
run: | | ||
CWAGENT_COMPONENTS=$(grep -o 'amazon-contributing/opentelemetry-collector-contrib/[^[:space:]/]*/[^[:space:]]*' amazon-cloudwatch-agent/go.mod | \ | ||
grep -v 'pull' | \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Guessing this is to ignore the comments with PR links. |
||
sed -n 's|amazon-contributing/opentelemetry-collector-contrib/\([^/]*/[^/]*\)$|./\1|p' | \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems like this will only work for packages that have only two levels (e.g. |
||
sort -u | tr '\n' ' ' | sed 's/ $//') | ||
echo "CWAGENT_COMPONENTS=$CWAGENT_COMPONENTS" >> $GITHUB_ENV | ||
- name: Checkout Repo | ||
uses: actions/checkout@v4 | ||
- name: Setup Go | ||
|
@@ -181,7 +180,9 @@ jobs: | |
if: steps.go-cache.outputs.cache-hit != 'true' | ||
run: make install-tools | ||
- name: Run `govulncheck` | ||
run: make -j2 gogovulncheck GROUP=${{ matrix.group }} | ||
run: make -j2 gogovulncheck GROUP=cwagent | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you have it print out the components it's checking? |
||
env: | ||
CWAGENT_COMPONENTS: ${{ env.CWAGENT_COMPONENTS }} | ||
checks: | ||
runs-on: ubuntu-latest | ||
needs: [setup-environment] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Don't need the matrix if it's only one item.