diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..5c61521 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,16 @@ +root = true + +[*] +charset = utf-8 +indent_size = 2 +indent_style = space +insert_final_newline = true +trim_trailing_whitespace = true + +[Makdefile,go.mod,go.sum,*.go,.gitmodules] +indent_style = tab +indent_size = 4 + +[*.{md,Rmd,rst}] +indent_size = 4 +trim_trailing_whitespace = false diff --git a/.github/workflows/verBumpChkr.yml b/.github/workflows/verBumpChkr.yml new file mode 100644 index 0000000..fd6eb47 --- /dev/null +++ b/.github/workflows/verBumpChkr.yml @@ -0,0 +1,26 @@ +name: Version Bump Check + +on: + pull_request: + types: [opened, reopened, synchronize] + +env: + FILE_PATH: 'cmd/root.go' # Path to file with version string + VERSION_PATTERN: 'Version: "v[0-9]\+\.[0-9]\+\.[0-9]\+",' # Version string regex pattern + +jobs: + version-check: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + with: + fetch-depth: 2 + - name: Check if Version String is Updated + run: | + if git diff -U0 --diff-filter 'AM' -r HEAD^1 HEAD -- "$FILE_PATH" | grep -q "$VERSION_PATTERN"; then + echo "##### ✅ Version updated in $FILE_PATH" >> "$GITHUB_STEP_SUMMARY" + else + echo "##### ❌ Version NOT updated in $FILE_PATH" >> "$GITHUB_STEP_SUMMARY" + exit 1 + fi diff --git a/cmd/root.go b/cmd/root.go index 1e98b38..a76f85f 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -311,8 +311,9 @@ func deduplicateSlice(s []string) []string { // rootCmd represents the base command when called without any subcommands var rootCmd = &cobra.Command{ - Use: "timeBuddy", - Short: "CLI version of World Time Buddy", + Use: "timeBuddy", + Version: "v1.1.3", + Short: "CLI version of World Time Buddy", Long: `timeBuddy is a Command Line Interface (CLI) tool designed to display the current time across multiple time zones. This tool is particularly useful for scheduling meetings with participants in various time zones. By default, timeBuddy includes your local time zone in its output. You can exclude your local time zone using the --exclude-local flag. @@ -343,7 +344,6 @@ Examples: Learn More: To submit feature requests, bugs, or to check for new versions, visit https://github.com/JakeTRogers/timeBuddy`, - Version: "v1.1.1", Args: func(cmd *cobra.Command, args []string) error { // if the --date flag was provided, validate it if cmd.Flags().Changed("date") {