Skip to content
This repository has been archived by the owner on Mar 24, 2022. It is now read-only.

Commit

Permalink
Create stale.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
lemon-mint authored Jan 28, 2022
1 parent aee1169 commit a585f47
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# This workflow warns and then closes issues and PRs that have had no activity for a specified amount of time.
#
# You can adjust the behavior by modifying this file.
# For more information, see:
# https://github.com/actions/stale
name: Mark stale issues and pull requests

on:
schedule:
- cron: '0 0 * * *'

jobs:
stale:

runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write

steps:
- uses: actions/stale@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'Stale issue message'
stale-pr-message: 'Stale pull request message'
stale-issue-label: 'no-issue-activity'
stale-pr-label: 'no-pr-activity'

2 comments on commit a585f47

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark Results (OS:linux)

Benchmark BenchmarkParseRequest

goos: linux
goarch: amd64
pkg: github.com/go-www/h1
cpu: Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz
BenchmarkParseRequest-2   	 5826975	       212.5 ns/op	       0 B/op	       0 allocs/op
PASS
ok  	github.com/go-www/h1	1.634s

CPU Profile

CPU Profile

Memory Profile

Memory Profile

Benchmark Benchmark_stricmp

goos: linux
goarch: amd64
pkg: github.com/go-www/h1
cpu: Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz
Benchmark_stricmp-2   	15898777	        74.45 ns/op	       0 B/op	       0 allocs/op
PASS
ok  	github.com/go-www/h1	1.419s

CPU Profile

CPU Profile

Memory Profile

Memory Profile

Benchmark Benchmark_ContentLength_stricmp

goos: linux
goarch: amd64
pkg: github.com/go-www/h1
cpu: Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz
Benchmark_ContentLength_stricmp-2   	45033758	        27.46 ns/op	       0 B/op	       0 allocs/op
PASS
ok  	github.com/go-www/h1	1.388s

CPU Profile

CPU Profile

Memory Profile

Memory Profile

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Golang CI Tools Report

Report generated at: 2022-01-28T07:28:55Z

Go version: go1.17.6

golang-ci-tools version: 0.1.2-dev

staticcheck

🎉  No staticcheck errors found!

gosec

** Issue Detected **

[gosec] 2022/01/28 07:28:58 Including rules: default
[gosec] 2022/01/28 07:28:58 Excluding rules: default
[gosec] 2022/01/28 07:28:58 Import directory: /home/runner/work/h1/h1
[gosec] 2022/01/28 07:28:59 Checking package: h1
[gosec] 2022/01/28 07:28:59 Checking file: /home/runner/work/h1/h1/any.go
[gosec] 2022/01/28 07:28:59 Checking file: /home/runner/work/h1/h1/headers.go
[gosec] 2022/01/28 07:28:59 Checking file: /home/runner/work/h1/h1/methods.go
[gosec] 2022/01/28 07:28:59 Checking file: /home/runner/work/h1/h1/nocopy.go
[gosec] 2022/01/28 07:28:59 Checking file: /home/runner/work/h1/h1/reader.go
[gosec] 2022/01/28 07:28:59 Checking file: /home/runner/work/h1/h1/request.go
[gosec] 2022/01/28 07:28:59 Checking file: /home/runner/work/h1/h1/response.go
[gosec] 2022/01/28 07:28:59 Checking file: /home/runner/work/h1/h1/status.go
[gosec] 2022/01/28 07:28:59 Checking file: /home/runner/work/h1/h1/strbytes.go
[gosec] 2022/01/28 07:28:59 Checking file: /home/runner/work/h1/h1/stricmp.go
[gosec] 2022/01/28 07:28:59 Import directory: /home/runner/work/h1/h1/fuzz
[gosec] 2022/01/28 07:28:59 Checking package: fuzz
[gosec] 2022/01/28 07:28:59 Checking file: /home/runner/work/h1/h1/fuzz/fuzz.go
[gosec] 2022/01/28 07:28:59 Import directory: /home/runner/work/h1/h1/tests
[gosec] 2022/01/28 07:28:59 Checking package: main
[gosec] 2022/01/28 07:28:59 Checking file: /home/runner/work/h1/h1/tests/run.go
[gosec] 2022/01/28 07:28:59 Checking file: /home/runner/work/h1/h1/tests/upload.go
[gosec] 2022/01/28 07:28:59 Import directory: /home/runner/work/h1/h1/tests/urlescape
[gosec] 2022/01/28 07:28:59 Checking package: main
[gosec] 2022/01/28 07:28:59 Checking file: /home/runner/work/h1/h1/tests/urlescape/escape.go
Results:


[/home/runner/work/h1/h1/tests/run.go:46] - G204 (CWE-78): Subprocess launched with a potential tainted input or cmd arguments (Confidence: HIGH, Severity: MEDIUM)
    45: 		var MemImageBuffer bytes.Buffer
  > 46: 		cmd = exec.Command("go", "tool", "pprof", "-png", "./testOutput/"+benchmark+"_memprofile.out")
    47: 		cmd.Stdout = &MemImageBuffer



[/home/runner/work/h1/h1/tests/run.go:37] - G204 (CWE-78): Subprocess launched with a potential tainted input or cmd arguments (Confidence: HIGH, Severity: MEDIUM)
    36: 		var CPUImageBuffer bytes.Buffer
  > 37: 		cmd = exec.Command("go", "tool", "pprof", "-png", "./testOutput/"+benchmark+"_profile.out")
    38: 		cmd.Stdout = &CPUImageBuffer



[/home/runner/work/h1/h1/tests/run.go:28] - G204 (CWE-78): Subprocess launched with a potential tainted input or cmd arguments (Confidence: HIGH, Severity: MEDIUM)
    27: 		var buffer bytes.Buffer
  > 28: 		cmd := exec.Command("go", "test", "-bench="+benchmark, "-benchmem", "-cpuprofile", "testOutput/"+benchmark+"_profile.out", "-memprofile", "testOutput/"+benchmark+"_memprofile.out")
    29: 		cmd.Stdout = &buffer



[/home/runner/work/h1/h1/tests/urlescape/escape.go:12] - G304 (CWE-22): Potential file inclusion via variable (Confidence: HIGH, Severity: MEDIUM)
    11: 	filename := os.Args[1]
  > 12: 	file, err := os.Open(filename)
    13: 	if err != nil {



[/home/runner/work/h1/h1/tests/run.go:19] - G301 (CWE-276): Expect directory permissions to be 0750 or less (Confidence: HIGH, Severity: MEDIUM)
    18: func main() {
  > 19: 	err := os.Mkdir("testOutput", 0777)
    20: 	if err != nil {



[/home/runner/work/h1/h1/tests/urlescape/escape.go:16] - G307 (CWE-703): Deferring unsafe method "Close" on type "*os.File" (Confidence: HIGH, Severity: MEDIUM)
    15: 	}
  > 16: 	defer file.Close()
    17: 	data, err := io.ReadAll(file)



[/home/runner/work/h1/h1/tests/upload.go:59] - G104 (CWE-703): Errors unhandled. (Confidence: HIGH, Severity: LOW)
    58: 	}
  > 59: 	multipartWriter.Close()
    60: 	resp, err := http.Post("https://api.imgbb.com/1/upload", multipartWriter.FormDataContentType(), &buffer)



[/home/runner/work/h1/h1/tests/upload.go:50] - G104 (CWE-703): Errors unhandled. (Confidence: HIGH, Severity: LOW)
    49: 	multipartWriter := multipart.NewWriter(&buffer)
  > 50: 	multipartWriter.WriteField("key", os.Getenv("IMGBB_API_KEY"))
    51: 	imgFileWriter, err := multipartWriter.CreateFormFile("image", imageName)



[/home/runner/work/h1/h1/fuzz/fuzz.go:11] - G104 (CWE-703): Errors unhandled. (Confidence: HIGH, Severity: LOW)
    10: 	var r h1.Request
  > 11: 	h1.ParseRequest(&r, bytes.NewReader(data))
    12: 	return 0



Summary:
  Gosec  : dev
  Files  : 14
  Lines  : 916
  Nosec  : 3
  Issues : 9


gocap

github.com/go-www/h1 (network, reflect, unsafe)


go-licenses

Package Name License File License
github.com/go-www/h1 https://github.com/go-www/h1/blob/master/LICENSE MIT

Dependencies

Total dependencies: 0

Show Full Dependencies

Please sign in to comment.