diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..477d49b --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,22 @@ +version: 2 +updates: + - package-ecosystem: "gomod" + directory: "/" + schedule: + interval: "daily" + time: "08:00" + labels: + - "dependencies" + commit-message: + prefix: "feat" + include: "scope" + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" + time: "08:00" + labels: + - "dependencies" + commit-message: + prefix: "chore" + include: "scope" \ No newline at end of file diff --git a/.github/labeler.yml b/.github/labeler.yml index b1ac01d..3a60ece 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -10,6 +10,7 @@ example: documentation: - docs/**/* + - README.md dependencies: - go.mod diff --git a/.github/workflows/codeql.yaml b/.github/workflows/codeql.yaml index b95116e..b98894d 100644 --- a/.github/workflows/codeql.yaml +++ b/.github/workflows/codeql.yaml @@ -2,8 +2,14 @@ name: "codeql" on: push: branches: [ main ] + paths-ignore: + - 'docs/**' + - 'README.md' pull_request: branches: [ main ] + paths-ignore: + - 'docs/**' + - 'README.md' jobs: analyze: name: analyze diff --git a/.github/workflows/gitleaks.yaml b/.github/workflows/gitleaks.yaml index f69180f..ff57fd1 100644 --- a/.github/workflows/gitleaks.yaml +++ b/.github/workflows/gitleaks.yaml @@ -3,7 +3,13 @@ on: push: branches: ['main'] tags: ['v*'] + paths-ignore: + - 'docs/**' + - 'README.md' pull_request: + paths-ignore: + - 'docs/**' + - 'README.md' permissions: contents: read jobs: diff --git a/.github/workflows/grype.yaml b/.github/workflows/grype.yaml index ac31021..7ff094f 100644 --- a/.github/workflows/grype.yaml +++ b/.github/workflows/grype.yaml @@ -3,7 +3,13 @@ on: push: branches: ['main'] tags: ['v*'] + paths-ignore: + - 'docs/**' + - 'README.md' pull_request: + paths-ignore: + - 'docs/**' + - 'README.md' jobs: scan-source: name: scan-source diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index a9bea76..35ff7b7 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -5,7 +5,13 @@ on: - v* branches: - main + paths-ignore: + - 'docs/**' + - 'README.md' pull_request: + paths-ignore: + - 'docs/**' + - 'README.md' permissions: contents: read diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index beb1eca..654aa13 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,8 +3,14 @@ name: test on: push: branches: [ main ] + paths-ignore: + - 'docs/**' + - 'README.md' pull_request: branches: [ main ] + paths-ignore: + - 'docs/**' + - 'README.md' jobs: unit-test: @@ -19,6 +25,7 @@ jobs: - name: codecov uses: codecov/codecov-action@v3 with: + token: ${{ secrets.CODECOV_TOKEN }} flags: unittests fail_ci_if_error: true files: coverage.out diff --git a/README.md b/README.md index e086484..bf340ee 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Inspired by [Cobra](https://github.com/spf13/cobra). Cobra is a library for crea [![Release](https://img.shields.io/github/release/shipengqi/action.svg)](https://github.com/shipengqi/action/releases) [![License](https://img.shields.io/github/license/shipengqi/action)](https://github.com/shipengqi/action/blob/main/LICENSE) -## Quickstart +## Getting Started ```go cmd := &cobra.Command{ @@ -31,10 +31,10 @@ cmd := &cobra.Command{ func newSubAction1() *action.Action { return &action.Action{ - Name: "sub-action1", - Executable: func(act *action.Action) bool { - // do something - return true + Name: "sub-action1", + Executable: func(act *action.Action) bool { + // do something + return true }, Run: func(act *action.Action) error { return nil }, } @@ -53,8 +53,16 @@ func newSubAction2() *action.Action { ``` - `Executable`: whether is an executable action. -- `Execute()` will find the first executable action of the root action and execute it. +- `action.Execute()` will find the first executable action of the root action and execute it. If no executable action can be found, run the current action. + ## Documentation You can find the docs at [go docs](https://pkg.go.dev/github.com/shipengqi/action). + + +## 🔋 JetBrains OS licenses + +`action` had been being developed with **GoLand** under the **free JetBrains Open Source license(s)** granted by JetBrains s.r.o., hence I would like to express my thanks here. + +JetBrains Logo (Main) logo. \ No newline at end of file