Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes volume error when file in the root folder #5

Merged
merged 10 commits into from
May 4, 2023
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:

## set the input parameters for the action
with:
flag-file: ${{ github.workspace }}/config/flag-config.yaml
flag-file: ./config/flag-config.yaml
format: yaml
```

Expand Down
21 changes: 12 additions & 9 deletions run-lint.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Reset
GO_FEATURE_FLAG_LINT_DOCKER_TAG="v1"
Color_Off='\033[0m' # Text Reset

# Regular Colors
Expand Down Expand Up @@ -34,9 +35,9 @@ function fmtPrintln() {
esac
}

## Get the latest image of go-feature-flag-lint from source
fmtPrintln "info" "pulling the latest image of go-feature-flag-lint from source"
docker pull thomaspoignant/go-feature-flag-lint:latest
## Get the image of go-feature-flag-lint from source
fmtPrintln "info" "pulling the image of go-feature-flag-lint:${GO_FEATURE_FLAG_LINT_DOCKER_TAG} from source"
docker pull thomaspoignant/go-feature-flag-lint:${GO_FEATURE_FLAG_LINT_DOCKER_TAG}

## Input arguments
fmtPrintln "info" "input arguments: $1 and $2"
Expand All @@ -59,13 +60,16 @@ if [[ "$2" != "yaml" && "$2" != "json" && "$2" != "toml" ]]; then
exit 1
fi

configDir=$(dirname "$1")
configFile=$(basename "$1")
flagFile="$(pwd)/$1"
configDir=$(dirname "$flagFile")
configFile=$(basename "$flagFile")

## Run the linter against the config file
msg=$(docker run -v "${configDir}":/config --rm --name gofeatureflag_lint \
thomaspoignant/go-feature-flag-lint \
msg=$( { docker run -v "${configDir}":/config --rm --name gofeatureflag_lint \
thomaspoignant/go-feature-flag-lint:${GO_FEATURE_FLAG_LINT_DOCKER_TAG} \
--input-format="$2" \
--input-file=/config/"${configFile}")
--input-file=/config/"${configFile}"; } 2>&1)


## Check if the linter has any errors
if [[ $? != 0 || ! -z "${msg}" ]]; then
Expand All @@ -75,4 +79,3 @@ if [[ $? != 0 || ! -z "${msg}" ]]; then
fi

fmtPrintln "info" "linting passed"
exit 0