Skip to content

Commit

Permalink
refactor(AllowedTags): Changed the way we store the config
Browse files Browse the repository at this point in the history
Now it stores it as `tags: [allowed: []]` instead of `allowed_tags: []``
  • Loading branch information
Eduardo committed Jun 8, 2023
1 parent 4d348fa commit ac39bb9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ config :git_ops,
header: "Important Changes"
]
],
# Only add commits to the changelog that has the "backend" tag
allowed_tags: [
"backend"
tags: [
# Only add commits to the changelog that has the "backend" tag
allowed: ["backend"],
]
# Instructs the tool to manage your mix version in your `mix.exs` file
# See below for more information
Expand Down
2 changes: 1 addition & 1 deletion lib/git_ops/config.ex
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ defmodule GitOps.Config do
end)
end

def allowed_tags, do: Application.get_env(:git_ops, :allowed_tags) || :any
def allowed_tags, do: :git_ops |> Application.get_env(:tags, []) |> Keyword.get(:allowed, :any)

def prefix, do: Application.get_env(:git_ops, :version_tag_prefix) || ""

Expand Down
2 changes: 1 addition & 1 deletion test/config_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ defmodule GitOps.Test.ConfigTest do
Application.put_env(:git_ops, :changelog_file, "CUSTOM_CHANGELOG.md")
Application.put_env(:git_ops, :manage_readme_version, true)
Application.put_env(:git_ops, :types, custom: [header: "Custom"], docs: [hidden?: false])
Application.put_env(:git_ops, :allowed_tags, ["tag_1", "tag_2"])
Application.put_env(:git_ops, :tags, [allowed: ["tag_1", "tag_2"]])
Application.put_env(:git_ops, :version_tag_prefix, "v")
end

Expand Down

0 comments on commit ac39bb9

Please sign in to comment.