diff --git a/.github/workflows/hype.md b/.github/workflows/hype.md index 09740d0..c7496e7 100644 --- a/.github/workflows/hype.md +++ b/.github/workflows/hype.md @@ -12,17 +12,19 @@ You need to give permission to your GitHub Actions to create a pull request in y Under `Workflow Permissions` - - Check `Allow GitHub Actions to create and approve pull requests`. - - Check `Read and write permissions` +- Check `Allow GitHub Actions to create and approve pull requests`. +- Check `Read and write permissions` ### Personal Access Token Alternately, you can use tokens to give permission to your action. -It is recommend to use a GitHub [Personnal Acces Token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token#creating-a-fine-grained-personal-access-token) like: `${{ `{{secrets.PAT}}` }}` instead of using `{{ `${{secrets.GITHUB_TOKEN}}` }}` in GitHub Actions. +It is recommend to use a GitHub [Personnal Acces Token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token#creating-a-fine-grained-personal-access-token) like: `${{`{{secrets.PAT}}`}}` instead of using `{{`${{secrets.GITHUB_TOKEN}}`}}` in GitHub Actions. ## The Action The current action is set to only generate the readme on a pull request and commit it back to that same pull request. You can modify this to your own needs. +It should be noted that we are ignoring the `docs` directory in our workflow because we purposefully have broken code examples. You should not do this. Your can simply run `go test ./...` and `staticcheck ./...` respectively in your actions. + diff --git a/.github/workflows/hype.yml b/.github/workflows/hype.yml index e7ab556..11511ba 100644 --- a/.github/workflows/hype.yml +++ b/.github/workflows/hype.yml @@ -11,7 +11,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v4 with: - go-version: "1.22.x" + go-version: "1.23.x" cache-dependency-path: subdir/go.sum - name: Install hype run: go install github.com/gopherguides/hype/cmd/hype@latest diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0522112..6e79f47 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -6,14 +6,14 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - go-version: [1.22.x] + go-version: [1.23.x] os: [macos-latest, ubuntu-latest] steps: - uses: actions/checkout@v4 - name: Set up Go uses: actions/setup-go@v4 with: - go-version: "1.22.x" + go-version: "1.23.x" - name: Go Environment run: go env - name: Verify Go Modules @@ -21,8 +21,12 @@ jobs: - name: Build run: go build -v ./cmd/hype/ - name: Run tests with Race Detector - run: go test -race -vet=off ./... + run: | + go_dirs=$(go list ./... | grep -v '/docs') + go test -race -vet=off $go_dirs - name: Install staticcheck run: go install honnef.co/go/tools/cmd/staticcheck@latest - name: Run staticcheck - run: staticcheck ./... + run: | + go_dirs=$(go list ./... | grep -v '/docs') + staticcheck $go_dirs diff --git a/README.md b/README.md index 99eebbf..c41b33b 100644 --- a/README.md +++ b/README.md @@ -127,7 +127,7 @@ $ go run . Hello World -------------------------------------------------------------------------------- -Go Version: go1.22.6 +Go Version: go1.23.1 ``` @@ -160,7 +160,7 @@ $ go run . Hello World -------------------------------------------------------------------------------- -Go Version: go1.22.6 +Go Version: go1.23.1 ``` @@ -189,7 +189,7 @@ $ go run . Hello World -------------------------------------------------------------------------------- -Go Version: go1.22.6 +Go Version: go1.23.1 ``` @@ -219,7 +219,7 @@ $ go run . ./main.go:7:6: undefined: fmt.Prin -------------------------------------------------------------------------------- -Go Version: go1.22.6 +Go Version: go1.23.1 ``` @@ -256,7 +256,7 @@ type Context interface{ ... } func WithoutCancel(parent Context) Context -------------------------------------------------------------------------------- -Go Version: go1.22.6 +Go Version: go1.23.1 ``` @@ -279,7 +279,7 @@ func WithCancel(parent Context) (ctx Context, cancel CancelFunc) call cancel as soon as the operations running in this Context complete. -------------------------------------------------------------------------------- -Go Version: go1.22.6 +Go Version: go1.23.1 ``` @@ -1269,6 +1269,8 @@ It is recommend to use a GitHub [Personnal Acces Token](https://docs.github.com/ The current action is set to only generate the readme on a pull request and commit it back to that same pull request. You can modify this to your own needs. +It should be noted that we are ignoring the `docs` directory in our workflow because we purposefully have broken code examples. You should not do this. Your can simply run `go test ./...` and `staticcheck ./...` respectively in your actions. + ```yml name: Generate README with Hype on: [pull_request] @@ -1283,7 +1285,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v4 with: - go-version: "1.22.x" + go-version: "1.23.x" cache-dependency-path: subdir/go.sum - name: Install hype run: go install github.com/gopherguides/hype/cmd/hype@latest