Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
adrian-velonis1 committed Dec 13, 2024
2 parents d43cddc + b48b79b commit 8baf7e8
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/send-docs-redirects-to-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,23 @@ jobs:
role-to-assume: ${{ secrets.AWS_ADMIN_GITHUB_OIDC_ROLE_ARN_DOCS }}
aws-region: us-east-1

- name: Check website redirects format
run: |
INVALID_REDIRECTS=$(grep -P 'website_redirect\s*=\s*"[^/h]|website_redirect\s*=\s*"h(?!ttps?://)' variables.tf || true)
if [ ! -z "$INVALID_REDIRECTS" ]; then
echo "❌ Error: Found website_redirect entries with invalid format:"
echo "----------------------------------------"
echo "$INVALID_REDIRECTS" | while read -r line; do
echo -e "\033[31m$line\033[0m"
done
echo "----------------------------------------"
echo "website_redirect must start with either '/' or 'http'"
echo "Examples:"
echo " website_redirect = \"/home.html\""
echo " website_redirect = \"https://example.com\""
exit 1
fi
- name: Terraform Format
if: ${{ github.event_name == 'pull_request' }}
id: fmt
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/send-enterprise-redirects-to-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,23 @@ jobs:
role-to-assume: ${{ secrets.AWS_ADMIN_GITHUB_OIDC_ROLE_ARN_DOCS }}
aws-region: us-east-1

- name: Check website redirects format
run: |
INVALID_REDIRECTS=$(grep -P 'website_redirect\s*=\s*"[^/h]|website_redirect\s*=\s*"h(?!ttps?://)' variables.tf || true)
if [ ! -z "$INVALID_REDIRECTS" ]; then
echo "❌ Error: Found website_redirect entries with invalid format:"
echo "----------------------------------------"
echo "$INVALID_REDIRECTS" | while read -r line; do
echo -e "\033[31m$line\033[0m"
done
echo "----------------------------------------"
echo "website_redirect must start with either '/' or 'http'"
echo "Examples:"
echo " website_redirect = \"/home.html\""
echo " website_redirect = \"https://example.com\""
exit 1
fi
- name: Terraform Format
if: ${{ github.event_name == 'pull_request' }}
id: fmt
Expand Down

0 comments on commit 8baf7e8

Please sign in to comment.