File tree Expand file tree Collapse file tree 10 files changed +177
-0
lines changed Expand file tree Collapse file tree 10 files changed +177
-0
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ version : 2
3+ updates :
4+ - package-ecosystem : " docker"
5+ directory : " /"
6+ schedule :
7+ interval : " weekly"
8+ groups :
9+ docker-all :
10+ patterns :
11+ - " *"
12+ - package-ecosystem : " github-actions"
13+ directory : " /"
14+ schedule :
15+ interval : " weekly"
16+ groups :
17+ github-actions-all :
18+ patterns :
19+ - " *"
20+ - package-ecosystem : " gomod"
21+ directory : " /"
22+ schedule :
23+ interval : " weekly"
24+ groups :
25+ gomod-all :
26+ patterns :
27+ - " *"
Original file line number Diff line number Diff line change 1+ ---
2+ name : Golang
3+ " on " :
4+ # required by gomod-go-version-updater to trigger this action once pr has
5+ # been reviewed
6+ pull_request_review :
7+ types : [submitted]
8+ push :
9+ permissions :
10+ contents : read
11+ packages : read
12+ jobs :
13+ mcvs-golang-action :
14+ # yamllint disable rule:braces
15+ # yamllint disable rule:indentation
16+ strategy :
17+ matrix :
18+ args :
19+ - { testing-type: "component" }
20+ - { testing-type: "coverage" }
21+ - { testing-type: "integration" }
22+ - { testing-type: "lint", build-tags: "component" }
23+ - { testing-type: "lint", build-tags: "e2e" }
24+ - { testing-type: "lint", build-tags: "integration" }
25+ - { testing-type: "security-golang-modules" }
26+ - { testing-type: "security-grype" }
27+ - { testing-type: "security-trivy" }
28+ - { testing-type: "unit" }
29+ runs-on : ubuntu-22.04
30+ # yamllint enable rule:braces
31+ # yamllint enable rule:indentation
32+ env :
33+ TASK_X_REMOTE_TASKFILES : 1
34+ steps :
35+ - uses : actions/checkout@v4.2.2
36+ - uses : schubergphilis/mcvs-golang-action@v0.16.1
37+ with :
38+ code-coverage-expected : 0.0
39+ build-tags : ${{ matrix.args.build-tags }}
40+ golang-unit-tests-exclusions : |-
41+ \(cmd\/mcvs-scanner\|cmd\/mcvs-scanner-cli\|deprecated\|api\/swagger\|mocks\)
42+ testing-type : ${{ matrix.args.testing-type }}
Original file line number Diff line number Diff line change 1+ ---
2+ name : gomod-go-version-updater-action
3+ " on " :
4+ schedule :
5+ - cron : " 42 5 * * 1-5"
6+ permissions :
7+ contents : write
8+ pull-requests : write
9+ repository-projects : write
10+ jobs :
11+ gomod-go-version-updater-action :
12+ runs-on : ubuntu-22.04
13+ steps :
14+ - uses : schubergphilis/gomod-go-version-updater-action@v0.2.2
Original file line number Diff line number Diff line change 1+ ---
2+ name : MCVS-PR-validation-action
3+ " on " :
4+ pull_request :
5+ types :
6+ - edited
7+ - opened
8+ - reopened
9+ - synchronize
10+ workflow_call :
11+ permissions :
12+ contents : read
13+ pull-requests : read
14+ jobs :
15+ MCVS-PR-validation-action :
16+ runs-on : ubuntu-22.04
17+ steps :
18+ - uses : actions/checkout@v4.2.2
19+ - uses : schubergphilis/mcvs-pr-validation-action@v0.2.0
Original file line number Diff line number Diff line change 1+ ---
2+ name : Close stale issues and PRs
3+ " on " :
4+ schedule :
5+ - cron : " 42 4 * * 1-5"
6+ permissions :
7+ contents : write
8+ issues : write
9+ pull-requests : write
10+ jobs :
11+ stale :
12+ runs-on : ubuntu-22.04
13+ steps :
14+ - uses : actions/stale@v9.1.0
15+ with :
16+ days-before-stale : 21
17+ days-before-close : 7
18+ exempt-pr-labels : " dependencies,security"
19+ stale-issue-message : |
20+ Issue will be marked as stale because it has not been updated in a
21+ while.
22+ stale-pr-message : |
23+ PR will be marked as stale because it has not been updated in a
24+ while.
Original file line number Diff line number Diff line change 1+ .task
2+ .vscode
Original file line number Diff line number Diff line change 1+ ---
2+ version : 3
3+
4+ vars :
5+ REMOTE_URL : https://raw.githubusercontent.com
6+ REMOTE_URL_REF : v0.15.5
7+ REMOTE_URL_REPO : schubergphilis/mcvs-golang-action
8+
9+ includes :
10+ remote :
11+ taskfile : >-
12+ {{.REMOTE_URL}}/{{.REMOTE_URL_REPO}}/{{.REMOTE_URL_REF}}/Taskfile.yml
Original file line number Diff line number Diff line change 1+ module github.com/schubergphilis.com/mcvs-golang-project-root
2+
3+ go 1.23.4
Original file line number Diff line number Diff line change 1+ package projectroot
2+
3+ import (
4+ "fmt"
5+ "os"
6+ "path/filepath"
7+ )
8+
9+ // FindProjectRoot finds the root directory of the project.
10+ func FindProjectRoot () (string , error ) {
11+ currentDir , err := os .Getwd ()
12+ if err != nil {
13+ return "" , err
14+ }
15+
16+ for {
17+ if fileExists (filepath .Join (currentDir , "go.mod" )) {
18+ return currentDir , nil
19+ }
20+
21+ parentDir := filepath .Dir (currentDir )
22+ if currentDir == parentDir {
23+ break
24+ }
25+ currentDir = parentDir
26+ }
27+
28+ return "" , fmt .Errorf ("project root not found" )
29+ }
30+
31+ func fileExists (path string ) bool {
32+ _ , err := os .Stat (path )
33+ return ! os .IsNotExist (err )
34+ }
You can’t perform that action at this time.
0 commit comments