From ec04960707c0ea75ad19939dd84dc4aeebed1227 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Galisteo?= Date: Wed, 31 Dec 2025 23:49:28 +0100 Subject: [PATCH 1/3] Add manifest file --- stacktodate.yml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 stacktodate.yml diff --git a/stacktodate.yml b/stacktodate.yml new file mode 100644 index 0000000..6c35789 --- /dev/null +++ b/stacktodate.yml @@ -0,0 +1,6 @@ +uuid: 1fe0b376-1df7-4848-bf2d-525acdce6b82 +name: stacktodate-cli +stack: + go: + version: "1.25" + source: go.mod From c3f87caea2dbb5c8c5ef4ee791e1da03b836ed6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Galisteo?= Date: Thu, 1 Jan 2026 18:46:15 +0100 Subject: [PATCH 2/3] Fix check command detecting versions in wrong directory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The check command was resolving config paths incorrectly when no -c flag was provided. With an empty checkConfigFile, ResolveAbsPath("") would resolve to the current directory as an absolute path, and GetConfigDir() would then extract its parent directory instead of the config directory. This caused version detection to happen in a different directory than when -c stacktodate.yml was explicitly specified, resulting in different outcomes for the same check. Fix: Set checkConfigFile to the default "stacktodate.yml" before any path resolution, ensuring consistent behavior regardless of whether the -c flag is provided. 🤖 Generated with Claude Code Co-Authored-By: Claude Haiku 4.5 --- .github/workflows/test.yml | 6 ++++++ cmd/check.go | 11 ++++++----- cmd/update.go | 1 + 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 950e3b1..297bed5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,3 +26,9 @@ jobs: - name: Run tests run: go test -v ./... + + - name: Build stacktodate + run: go build -o stacktodate + + - name: Check stacktodate config + run: ./stacktodate check diff --git a/cmd/check.go b/cmd/check.go index c4208b7..2bcf03e 100644 --- a/cmd/check.go +++ b/cmd/check.go @@ -44,6 +44,11 @@ var checkCmd = &cobra.Command{ Short: "Check if detected versions match stacktodate.yml", Long: `Verify that the versions in stacktodate.yml match the currently detected versions in your project. Useful for CI/CD pipelines.`, Run: func(cmd *cobra.Command, args []string) { + // Use default config file if not specified + if checkConfigFile == "" { + checkConfigFile = "stacktodate.yml" + } + // Load config without requiring UUID config, err := helpers.LoadConfig(checkConfigFile) if err != nil { @@ -53,11 +58,7 @@ var checkCmd = &cobra.Command{ // Resolve absolute path for directory management absConfigPath, err := helpers.ResolveAbsPath(checkConfigFile) if err != nil { - if checkConfigFile == "" { - absConfigPath, _ = helpers.ResolveAbsPath("stacktodate.yml") - } else { - helpers.ExitOnError(err, "failed to resolve config path") - } + helpers.ExitOnError(err, "failed to resolve config path") } // Get config directory diff --git a/cmd/update.go b/cmd/update.go index 3d759c7..1dc5e12 100644 --- a/cmd/update.go +++ b/cmd/update.go @@ -87,6 +87,7 @@ var updateCmd = &cobra.Command{ var updateConfigFile string func init() { + rootCmd.AddCommand(updateCmd) // Flags for update command updateCmd.Flags().StringVarP(&updateConfigFile, "config", "c", "stacktodate.yml", "Path to stacktodate.yml config file (default: stacktodate.yml)") updateCmd.Flags().BoolVar(&skipAutodetect, "skip-autodetect", false, "Skip autodetection of project technologies") From b32c8eb99781d0a08450dc9e559268329d6a5bb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Galisteo?= Date: Thu, 1 Jan 2026 18:53:47 +0100 Subject: [PATCH 3/3] Add GitHub Actions workflow for syncing stacktodate config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a new workflow that runs on push to main/master branches to: - Build the stacktodate CLI - Verify the stacktodate.yml configuration matches detected versions - Push the configuration to the remote API for tracking This ensures the tech stack configuration stays synchronized and valid as part of the CI/CD pipeline. 🤖 Generated with Claude Code Co-Authored-By: Claude Haiku 4.5 --- .github/workflows/sync-stacktodate.yml | 30 ++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/sync-stacktodate.yml diff --git a/.github/workflows/sync-stacktodate.yml b/.github/workflows/sync-stacktodate.yml new file mode 100644 index 0000000..b058e43 --- /dev/null +++ b/.github/workflows/sync-stacktodate.yml @@ -0,0 +1,30 @@ +name: Sync Stack To Date + +on: + push: + branches: [ master, main ] + +jobs: + sync-stacktodate: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: '1.25' + + - name: Download dependencies + run: go mod download + + - name: Build stacktodate + run: go build -o stacktodate + + - name: Check stacktodate config + run: ./stacktodate check + + - name: Push stacktodate config + run: ./stacktodate push + env: + STD_TOKEN: ${{ secrets.STD_TOKEN }}