-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
117 additions
and
34 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,17 +15,18 @@ jobs: | |
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Check | ||
uses: stordco/[email protected] | ||
with: | ||
regex: '^(feat!|fix!|fix|feat|chore|(fix|feat|chore)\(\w.*\)):\s(\[\w{1,8}-\d{1,8}\]|.*).*' | ||
regex: '^(feat!|fix!|fix|feat|chore)(\(\w+\))?:\s(\[#\d{1,5}\])?.*$' | ||
hint: | | ||
You can pass the following formats: | ||
Your PR title does not match the Conventional Commits convention. Please rename your PR to match one of the following formats: | ||
fix: [123] some title of the PR | ||
fix(scope): [123] some title of the PR | ||
feat: [1234] some title of the PR | ||
fix: [#123] some title of the PR | ||
fix(scope): [#123] some title of the PR | ||
feat: [#1234] some title of the PR | ||
chore: update some action | ||
Note: Adding ! (i.e. `feat!:`) represents a breaking change and will result in a SemVer major release. | ||
See https://www.conventionalcommits.org/en/v1.0.0/ for more information. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/usr/bin/env bash | ||
|
||
# This file is responsible for detecting what deps and plugins are available for | ||
# the Elixir .formatter.exs file. To add a value in `import_deps`, add the package | ||
# name to the MIX_PACKAGES array below. | ||
|
||
MIX_PACKAGES=("ecto" "ecto_sql" "kafee" "open_api_spex" "patch" "phoenix" "stream_data" "typed_struct") | ||
|
||
# We iterate over all of the MIX_PACKAGES and check if they exist in the mix.lock file. | ||
# If they do, we add them to the FORMATTER_PACKAGES array. | ||
FORMATTER_PACKAGES=() | ||
|
||
if [ -f "mix.lock" ]; then | ||
echo "mix.lock file detected" | ||
|
||
for package in "${MIX_PACKAGES[@]}"; do | ||
if grep -q " \"${package}\": {" mix.lock; then | ||
echo "${package} detected in mix.lock file" | ||
FORMATTER_PACKAGES+=(":${package}") | ||
else | ||
echo "${package} not detected in mix.lock file" | ||
fi | ||
done | ||
fi | ||
|
||
# Next we do some custom detection for formatter plugin modules. This is not | ||
# really reusable because there is no good way to convert Phoenix.LiveView.HTMLFormatter | ||
# to :phoenix_live_view. Therefor it's all manually written out. | ||
FORMATTER_MODULES=() | ||
|
||
if [ -f "mix.lock" ]; then | ||
if grep -q ":phoenix_live_view," mix.lock; then | ||
echo "phoenix_live_view detected in mix.lock file" | ||
FORMATTER_MODULES+=("Phoenix.LiveView.HTMLFormatter") | ||
fi | ||
fi | ||
|
||
# And lastly, we template out all of the detected variables above into a comma separated | ||
# list and add them as template variables. | ||
FORMATTER_IMPORTS=$(printf "%s, " "${FORMATTER_PACKAGES[@]}" | cut -d "," -f 1-${#FORMATTER_PACKAGES[@]}) | ||
echo "FORMATTER_IMPORTS=${FORMATTER_IMPORTS}" >> "$TEMPLATE_ENV" | ||
|
||
FORMATTER_PLUGINS=$(printf "%s, " "${FORMATTER_MODULES[@]}" | cut -d "," -f 1-${#FORMATTER_MODULES[@]}) | ||
echo "FORMATTER_PLUGINS=${FORMATTER_PLUGINS}" >> "$TEMPLATE_ENV" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/usr/bin/env bash | ||
|
||
if [ -f "priv/repo/migrations/.formatter.exs" ]; then | ||
echo "removing repo migration formatter.exs file" | ||
rm -f priv/repo/migrations/.formatter.exs | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/env bash | ||
|
||
POSSIBLE_FILES=( | ||
".github/workflows/ci.yaml" | ||
".github/workflows/ci.yml" | ||
"docker-compose.yaml" | ||
"docker-compose.yml" | ||
) | ||
|
||
for POSSIBLE_FILE in "${POSSIBLE_FILES[@]}"; do | ||
if [ -f "$POSSIBLE_FILE" ]; then | ||
echo "Trying to parse existing postgres version from $POSSIBLE_FILE"; | ||
|
||
if grep -Eo "image:\s*postgres:([0-9\.])+" "$POSSIBLE_FILE"; then | ||
POSTGRES_VERSION=$(grep -Eo "image:\s*postgres:([0-9\.])+" "$POSSIBLE_FILE" | cut -d: -f3) | ||
|
||
echo "Detected Postgres version $POSTGRES_VERSION" | ||
echo "POSTGRES_VERSION=${POSTGRES_VERSION}" >> "$TEMPLATE_ENV" | ||
|
||
exit 0; | ||
fi | ||
fi | ||
done | ||
|
||
echo "Unable to find any current Postgres version" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/env bash | ||
|
||
if [ -f "mix.exs" ]; then | ||
echo "mix.exs file detected" | ||
|
||
if grep -q "defp package do" mix.exs; then | ||
echo "Detected a package function head in mix.exs" | ||
echo "IS_MIX_PACKAGE=true" >> "$TEMPLATE_ENV" | ||
|
||
exit 0; | ||
fi | ||
fi | ||
|
||
echo "Did not detect a package function head in mix.exs" |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,21 +14,22 @@ on: | |
jobs: | ||
Title: | ||
if: $\{{ github.event_name == 'pull_request' }} | ||
|
||
name: Check Title | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check | ||
uses: stordco/[email protected] | ||
with: | ||
regex: '^(feat!|fix!|fix|feat|chore|(fix|feat|chore)\(\w.*\)):\s(\[\w{1,8}-\d{1,8}\]|.*).*' | ||
regex: '^(feat!|fix!|fix|feat|chore)(\(\w+\))?:\s(\[#\d{1,5}\])?.*$' | ||
hint: | | ||
Your PR title does not match the Stord common convention. Please rename your PR to match one of the following formats: | ||
Your PR title does not match the Conventional Commits convention. Please rename your PR to match one of the following formats: | ||
chore: a small insignificant change | ||
fix: [1234] fix an existing feature | ||
feat: [1234] a new feature to release | ||
feat!: a breaking change | ||
fix: [#123] some title of the PR | ||
fix(scope): [#123] some title of the PR | ||
feat: [#1234] some title of the PR | ||
chore: update some action | ||
Note: Adding ! (i.e. `feat!:`) represents a breaking change and will result in a SemVer major release. | ||
See https://www.conventionalcommits.org/en/v1.0.0/ for more information. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters