ci: bump to Go 1.26 and address PR review feedback

The autofix failure is fixed properly by moving to Go 1.26 instead of the
GOTOOLCHAIN workaround. The official golangci-lint v2.12.2 binary is built
with go1.26.2 and lints a Go 1.26 target fine (the earlier "not ready"
claim was from a locally go-installed binary compiled with Go 1.25), and
the Dockerfiles already use golang:1.26-alpine, so this also aligns the
module with the images.

- go.mod: go 1.25.0 -> 1.26.0, drop the toolchain pin (keeps the lint
  target at the go directive).
- Taskfile: revert modernize to plain modernize@latest; on Go 1.26 the
  GOTOOLCHAIN dance and its comments are unnecessary.
- ci.yml: pass the resolved Go version through an env var (GO_VERSION)
  instead of interpolating steps.setup-go.outputs.go-version directly into
  shell scripts (script-injection hygiene); grant the dependency-review job
  pull-requests: write so it can post its summary.
- parser.go: derive defaultBaseURL from riseHost instead of duplicating the
  host string; drop the redundant per-const comments.
- .golangci.yml: remove the redundant go-version comment.
- regenerate internal/exporters/output.docx.
This commit is contained in:
2026-06-15 17:42:49 +00:00
parent b6f55156c4
commit ea3f74c1b3
6 changed files with 24 additions and 25 deletions
+20 -10
View File
@@ -46,6 +46,13 @@ jobs:
go-version-file: go.mod go-version-file: go.mod
check-latest: true check-latest: true
# Expose the resolved Go version as an env var so it is never
# interpolated directly into a shell script (avoids script injection).
- name: Export Go version
env:
GO_VERSION: ${{ steps.setup-go.outputs.go-version }}
run: echo "GO_VERSION=$GO_VERSION" >> "$GITHUB_ENV"
- name: Install Task - name: Install Task
uses: go-task/setup-task@v1 uses: go-task/setup-task@v1
@@ -66,7 +73,7 @@ jobs:
{ {
cat << EOF cat << EOF
## 🔧 Test Environment ## 🔧 Test Environment
- **Go Version:** ${{ steps.setup-go.outputs.go-version }} - **Go Version:** $GO_VERSION
- **OS:** ubuntu-latest - **OS:** ubuntu-latest
- **Timestamp:** $(date -u) - **Timestamp:** $(date -u)
@@ -86,7 +93,7 @@ jobs:
# Generate test summary # Generate test summary
{ {
cat << EOF cat << EOF
## 🧪 Test Results (Go ${{ steps.setup-go.outputs.go-version }}) ## 🧪 Test Results (Go $GO_VERSION)
| Metric | Value | | Metric | Value |
| ----------- | ------------------------------------------------------------- | | ----------- | ------------------------------------------------------------- |
@@ -148,7 +155,7 @@ jobs:
{ {
cat << EOF cat << EOF
## 📊 Code Coverage (Go ${{ steps.setup-go.outputs.go-version }}) ## 📊 Code Coverage (Go $GO_VERSION)
**Total Coverage: $COVERAGE** **Total Coverage: $COVERAGE**
@@ -209,7 +216,7 @@ jobs:
if: failure() if: failure()
uses: actions/upload-artifact@v6 uses: actions/upload-artifact@v6
with: with:
name: test-results-go-${{ steps.setup-go.outputs.go-version }} name: test-results-go-${{ env.GO_VERSION }}
path: | path: |
test-output.log test-output.log
coverage/ coverage/
@@ -219,7 +226,7 @@ jobs:
run: | run: |
{ {
cat << EOF cat << EOF
## 🔍 Static Analysis (Go ${{ steps.setup-go.outputs.go-version }}) ## 🔍 Static Analysis (Go $GO_VERSION)
EOF EOF
@@ -263,9 +270,10 @@ jobs:
- name: Job Summary - name: Job Summary
if: always() if: always()
run: | run: |
cat >> "$GITHUB_STEP_SUMMARY" << 'EOF' {
## 📋 Job Summary (Go ${{ steps.setup-go.outputs.go-version }}) echo "## 📋 Job Summary (Go $GO_VERSION)"
echo ""
cat << 'EOF'
| Step | Status | | Step | Status |
| --------------- | --------------------------------------------------------------- | | --------------- | --------------------------------------------------------------- |
| Dependencies | Success | | Dependencies | Success |
@@ -275,12 +283,13 @@ jobs:
| Static Analysis | ${{ job.status == 'success' && 'Clean' || 'Issues' }} | | Static Analysis | ${{ job.status == 'success' && 'Clean' || 'Issues' }} |
| Code Formatting | ${{ job.status == 'success' && 'Clean' || 'Issues' }} | | Code Formatting | ${{ job.status == 'success' && 'Clean' || 'Issues' }} |
EOF EOF
} >> "$GITHUB_STEP_SUMMARY"
- name: Upload coverage reports to Codecov - name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5 uses: codecov/codecov-action@v5
with: with:
files: ./coverage/coverage.out files: ./coverage/coverage.out
flags: Go ${{ steps.setup-go.outputs.go-version }} flags: Go ${{ env.GO_VERSION }}
slug: kjanat/articulate-parser slug: kjanat/articulate-parser
token: ${{ secrets.CODECOV_TOKEN }} token: ${{ secrets.CODECOV_TOKEN }}
@@ -288,7 +297,7 @@ jobs:
if: ${{ !cancelled() }} if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1 uses: codecov/test-results-action@v1
with: with:
flags: Go ${{ steps.setup-go.outputs.go-version }} flags: Go ${{ env.GO_VERSION }}
token: ${{ secrets.CODECOV_TOKEN }} token: ${{ secrets.CODECOV_TOKEN }}
docker-test: docker-test:
@@ -344,6 +353,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions: permissions:
contents: read contents: read
pull-requests: write
if: github.event_name == 'pull_request' if: github.event_name == 'pull_request'
steps: steps:
- name: "Checkout Repository" - name: "Checkout Repository"
-4
View File
@@ -8,10 +8,6 @@ run:
# Timeout for total work # Timeout for total work
timeout: 5m timeout: 5m
# Skip directories (not allowed in config v2, will use issues exclude instead)
# Go version is autodetected from go.mod
# Include test files # Include test files
tests: true tests: true
+1 -4
View File
@@ -266,10 +266,7 @@ tasks:
silent: true silent: true
aliases: [modern] aliases: [modern]
cmds: cmds:
# The modernize analyzer (shipped with gopls) may require a newer Go - go run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@latest -fix -test ./...
# toolchain than this project targets, so it is run with GOTOOLCHAIN=auto
# to let Go fetch the toolchain it needs on demand.
- GOTOOLCHAIN=auto go run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@latest -fix -test ./...
- echo "Code modernized" - echo "Code modernized"
# Dependency management # Dependency management
+1 -3
View File
@@ -1,8 +1,6 @@
module github.com/kjanat/articulate-parser module github.com/kjanat/articulate-parser
go 1.25.0 go 1.26.0
toolchain go1.25.5
require ( require (
github.com/fumiama/go-docx v0.0.0-20250506085032-0c30fd09304b github.com/fumiama/go-docx v0.0.0-20250506085032-0c30fd09304b
Binary file not shown.
+1 -3
View File
@@ -17,10 +17,8 @@ import (
// Default endpoint configuration for the Articulate Rise API. // Default endpoint configuration for the Articulate Rise API.
const ( const (
// Root URL for the Articulate Rise API.
defaultBaseURL = "https://rise.articulate.com"
// Expected host for Articulate Rise share URLs.
riseHost = "rise.articulate.com" riseHost = "rise.articulate.com"
defaultBaseURL = "https://" + riseHost
) )
// shareIDRegex is compiled once at package init for extracting share IDs from URIs. // shareIDRegex is compiled once at package init for extracting share IDs from URIs.