Skip to content

Commit

Permalink
Merge pull request #1177 from opentofu/abstractionfactory-patch-1
Browse files Browse the repository at this point in the history
Clearer error message on module submission
  • Loading branch information
abstractionfactory authored Oct 19, 2024
2 parents 7c7a245 + f006f50 commit b129500
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/scripts/submit-module.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ fi
repository=$(echo "${BODY}" | grep "### Module Repository" -A2 | tail -n1 | tr "[:upper:]" "[:lower:]" | sed -e 's/[\r\n]//g')

if [[ ! "${repository}" =~ ^[a-zA-Z0-9-]+/terraform-[a-zA-Z0-9-]+$ ]]; then
gh issue comment "${NUMBER}" -b "Failed validation: Invalid repository name: '${repository}'. Please submit the repository in the format of ORGANIZATION/terraform-NAME-TARGETSYSTEM."
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."
exit 1
fi

Expand Down Expand Up @@ -63,4 +63,4 @@ git push -u origin "${branch}"
# Create pull request and update issue
pr=$(gh pr create --title "${TITLE}" --body "Created ${jsonfile/../src/} for module ${namespace}/${name}/${target}. Closes #${NUMBER}.") #--assignee opentofu/core-engineers)
gh issue comment "${NUMBER}" -b "Your submission has been validated and has moved on to the pull request phase (${pr}). This issue has been locked."
gh issue lock "${NUMBER}" -r resolved
gh issue lock "${NUMBER}" -r resolved

0 comments on commit b129500

Please sign in to comment.