Skip to content

Commit

Permalink
🐛 Fixing Bug with latest version causing integration test to fail (#93)
Browse files Browse the repository at this point in the history
* 🔧 Using correct Version for Testing

* 🔧 Using correct go version

* 🔧 Printing config before build & run

* 🔧 Escaping Inputs explicit

* 🔧 Fixed "

* 🔧 Adjusted validation based on current occurence for 1.23

* 🐛 Setting go-version to the default go version.

v1.1.3 requires 1.21
  • Loading branch information
Templum authored Oct 25, 2024
1 parent 6e5b1a0 commit 0d775f4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.21'
go-version: '1.23'
- name: Compile Action
run: go build -v ./...
unit-testing:
Expand All @@ -34,7 +34,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.21'
go-version: '1.23'
- name: Run Unit Test with Racecondition Detector
run: go test -race ./...
- name: Run Unit Tests with Coverage
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.20.0
go-version: 1.21.4
- name: Compile Action
run: go build -ldflags="-w -s" -v -o action .
- name: Install govulncheck default version (v1.0.0)
run: go install golang.org/x/vuln/cmd/govulncheck@v1.0.0
- name: Install govulncheck default version (v1.1.3)
run: go install golang.org/x/vuln/cmd/govulncheck@v1.1.3
- name: Run action against local version of the action
run: ./action
env:
Expand All @@ -37,7 +37,7 @@ jobs:
rules=$(cat govulncheck-report.sarif | jq '.runs[0].tool.driver.rules | length')
occurrences=$(cat govulncheck-report.sarif | jq '.runs[0].results | length')
if [[ $rules -ge 10 ]]; then echo "Found expected number of rules"; else echo "Found unexpected number of rules $rules expected 10"; exit 1; fi
if [[ $occurrences -ge 30 ]]; then echo "Found expected number of call sites"; else echo "Found unexpected number of call sites ($occurrences expected 30)"; exit 1; fi
if [[ $occurrences -ge 3 ]]; then echo "Found expected number of call sites"; else echo "Found unexpected number of call sites ($occurrences expected 30)"; exit 1; fi
- name: Upload Report if Test failed
if: ${{ failure() }}
uses: actions/upload-artifact@v4
Expand All @@ -57,7 +57,7 @@ jobs:
uses: Templum/govulncheck-action@main
with:
skip-upload: true
go-version: 1.20.0
go-version: 1.21.4
env:
GH_PAT_TOKEN: ${{ secrets.PAT_TOKEN }}
GOPRIVATE: "github.com/Templum/private-lib"
Expand Down
5 changes: 4 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,11 @@ inputs:
runs:
using: "composite"
steps:
- id: config
run: echo "GOLANG_VERSION=${{ inputs.go-version }} VULNCHECK_VERSION=${{ inputs.vulncheck-version }}"
shell: bash
- id: build
run: docker build --build-arg GOLANG_VERSION=${{ inputs.go-version }} --build-arg GH_PAT_TOKEN=$GH_PAT_TOKEN --build-arg GOPRIVATE=$GOPRIVATE --build-arg VULNCHECK_VERSION=${{ inputs.vulncheck-version }} -q -f $GITHUB_ACTION_PATH/Dockerfile -t templum/govulncheck-action:local $GITHUB_ACTION_PATH
run: docker build --build-arg GOLANG_VERSION="${{ inputs.go-version }}" --build-arg GH_PAT_TOKEN=$GH_PAT_TOKEN --build-arg GOPRIVATE=$GOPRIVATE --build-arg VULNCHECK_VERSION="${{ inputs.vulncheck-version }}" -q -f $GITHUB_ACTION_PATH/Dockerfile -t templum/govulncheck-action:local $GITHUB_ACTION_PATH
shell: bash
- id: run
run: docker run --rm -v $(pwd):/github/workspace --workdir /github/workspace -e GITHUB_TOKEN=${{ inputs.github-token }} -e STRICT=${{ inputs.fail-on-vuln }} -e PACKAGE=${{ inputs.package }} -e SKIP_UPLOAD=${{ inputs.skip-upload }} -e DEBUG=${DEBUG} -e GITHUB_REPOSITORY=${{ github.repository }} -e GITHUB_REF=${{ github.ref }} -e GITHUB_SHA=${{ github.sha }} templum/govulncheck-action:local
Expand Down

0 comments on commit 0d775f4

Please sign in to comment.