mirror of
https://github.com/ivuorinen/go-test-sarif.git
synced 2026-02-05 16:45:50 +00:00
fix(docs): resolve markdown lint errors (#16)
This commit is contained in:
43
.github/README.md
vendored
43
.github/README.md
vendored
@@ -1,12 +1,11 @@
|
||||
# go-test-sarif and go-test-sarif-action
|
||||
# go-test-sarif
|
||||
|
||||
`go-test-sarif` is a CLI tool and GitHub Action for converting `go test -json` output into SARIF format,
|
||||
`go-test-sarif` is a CLI tool for converting `go test -json` output into SARIF format,
|
||||
making it compatible with GitHub Security Tab and other SARIF consumers.
|
||||
|
||||
## 🚀 Features
|
||||
|
||||
- Converts `go test -json` output to **SARIF format**.
|
||||
- **GitHub Action integration** for CI/CD pipelines.
|
||||
- Generates structured test failure reports for **security and compliance tools**.
|
||||
- Works as a **standalone CLI tool**.
|
||||
|
||||
@@ -18,12 +17,6 @@ making it compatible with GitHub Security Tab and other SARIF consumers.
|
||||
go install github.com/ivuorinen/go-test-sarif-action@latest
|
||||
```
|
||||
|
||||
### Using Docker
|
||||
|
||||
```sh
|
||||
docker pull ghcr.io/ivuorinen/go-test-sarif-action:latest
|
||||
```
|
||||
|
||||
## 🛠️ Usage
|
||||
|
||||
### CLI Usage
|
||||
@@ -33,35 +26,10 @@ go test -json ./... > go-test-results.json
|
||||
go-test-sarif go-test-results.json go-test-results.sarif
|
||||
```
|
||||
|
||||
### Docker Usage
|
||||
|
||||
```sh
|
||||
docker run --rm -v $(pwd):/workspace ghcr.io/ivuorinen/go-test-sarif-action go-test-results.json go-test-results.sarif
|
||||
```
|
||||
|
||||
### GitHub Action Usage
|
||||
|
||||
Add the following step to your GitHub Actions workflow:
|
||||
|
||||
```yaml
|
||||
- name: Convert JSON to SARIF
|
||||
uses: ivuorinen/go-test-sarif-action@v1
|
||||
with:
|
||||
test_results: go-test-results.json
|
||||
```
|
||||
|
||||
To upload the SARIF file to GitHub Security Tab, add:
|
||||
|
||||
```yaml
|
||||
- name: Upload SARIF report
|
||||
uses: github/codeql-action/upload-sarif@v2
|
||||
with:
|
||||
sarif_file: go-test-results.sarif
|
||||
```
|
||||
|
||||
## 📜 Output Example
|
||||
|
||||
SARIF report example:
|
||||
|
||||
```json
|
||||
{
|
||||
"version": "2.1.0",
|
||||
@@ -100,9 +68,10 @@ SARIF report example:
|
||||
## 🏗 Development
|
||||
|
||||
Clone the repository and build the project:
|
||||
|
||||
```sh
|
||||
git clone https://github.com/ivuorinen/go-test-sarif-action.git
|
||||
cd go-test-sarif
|
||||
cd go-test-sarif-action
|
||||
go build -o go-test-sarif ./cmd/main.go
|
||||
```
|
||||
|
||||
@@ -118,4 +87,4 @@ This project is licensed under the **MIT License**.
|
||||
|
||||
## 🤝 Contributing
|
||||
|
||||
Pull requests are welcome! For major changes, please open an issue first to discuss the changes.
|
||||
Pull requests are welcome! For major changes, open an issue to discuss them.
|
||||
|
||||
24
.github/workflows/publish-immutable-actions.yml
vendored
24
.github/workflows/publish-immutable-actions.yml
vendored
@@ -1,24 +0,0 @@
|
||||
---
|
||||
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
|
||||
name: 'Publish Immutable Action Version'
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
permissions: read-all
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
id-token: write
|
||||
packages: write
|
||||
|
||||
steps:
|
||||
- name: Checking out
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Publish
|
||||
id: publish
|
||||
uses: actions/publish-immutable-action@4bc8754ffc40f27910afb20287dbbbb675a4e978 # v0.0.4
|
||||
26
.github/workflows/release-new-action-version.yml
vendored
26
.github/workflows/release-new-action-version.yml
vendored
@@ -1,26 +0,0 @@
|
||||
---
|
||||
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
|
||||
name: Release new action version
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [released]
|
||||
|
||||
env:
|
||||
TAG_NAME: ${{ github.event.release.tag_name }}
|
||||
|
||||
permissions: read-all
|
||||
|
||||
jobs:
|
||||
update_tag:
|
||||
name: Update the major tag to include the ${{ env.TAG_NAME }} changes
|
||||
environment:
|
||||
name: releaseNewActionVersion
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- name: Update the ${{ env.TAG_NAME }} tag
|
||||
uses: actions/publish-action@f784495ce78a41bac4ed7e34a73f0034015764bb # v0.3.0
|
||||
with:
|
||||
source-tag: ${{ env.TAG_NAME }}
|
||||
5
.github/workflows/test.yml
vendored
5
.github/workflows/test.yml
vendored
@@ -28,10 +28,7 @@ jobs:
|
||||
run: go test -json ./... > go-test-results.json
|
||||
|
||||
- name: Convert JSON to SARIF
|
||||
uses: ivuorinen/go-test-sarif-action@58ffaaacdb178a5d053f8e8c2693966422a3ecda # v1
|
||||
with:
|
||||
input_file: go-test-results.json
|
||||
output_file: go-test-results.sarif
|
||||
run: go run ./cmd/main.go go-test-results.json go-test-results.sarif
|
||||
|
||||
- name: Upload SARIF to GitHub Security Tab
|
||||
uses: github/codeql-action/upload-sarif@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
|
||||
|
||||
Reference in New Issue
Block a user