Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/sync-stacktodate.yml
Original file line number Diff line number Diff line change
@@ -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 }}
6 changes: 6 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
11 changes: 6 additions & 5 deletions cmd/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions cmd/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
6 changes: 6 additions & 0 deletions stacktodate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
uuid: 1fe0b376-1df7-4848-bf2d-525acdce6b82
name: stacktodate-cli
stack:
go:
version: "1.25"
source: go.mod
Loading