Skip to content

Commit

Permalink
More lenient repo name handling
Browse files Browse the repository at this point in the history
Signed-off-by: AbstractionFactory <179820029+abstractionfactory@users.noreply.github.com>
  • Loading branch information
abstractionfactory committed Nov 21, 2024
1 parent 6ea1e50 commit 43912a3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/scripts/submit-module.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ if [[ -z "${NUMBER}" ]]; then
fi

repository=$(echo "${BODY}" | grep "### Module Repository" -A2 | tail -n1 | tr "[:upper:]" "[:lower:]" | sed -e 's/[\r\n]//g')
repository=$(echo -n "${repository}" | sed -e 's$https://github.com/$$' -e 's$github.com/$$')

if [[ ! "${repository}" =~ ^[a-zA-Z0-9-]+/terraform-[a-zA-Z0-9-]+$ ]]; then
gh issue comment "${NUMBER}" -b "Failed validation: Invalid repository name: '${repository}'. Please edit your issue to state the name of the repository in the format of ORGANIZATION/terraform-NAME-TARGETSYSTEM."
Expand Down
1 change: 1 addition & 0 deletions .github/scripts/submit-provider.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ if [[ -z "${NUMBER}" ]]; then
fi

repository=$(echo "${BODY}" | grep "### Provider Repository" -A2 | tail -n1 | tr "[:upper:]" "[:lower:]" | sed -e 's/[\r\n]//g')
repository=$(echo -n "${repository}" | sed -e 's$https://github.com/$$' -e 's$github.com/$$')

if [[ ! "${repository}" =~ ^[a-zA-Z0-9-]+/terraform-provider-[a-zA-Z0-9-]+$ ]]; then
gh issue comment "${NUMBER}" -b "Failed validation: Invalid repository name: '${repository}'. Please edit your issue to state the repository in the format of ORGANIZATION/terraform-provider-NAME."
Expand Down

0 comments on commit 43912a3

Please sign in to comment.