Skip to content

make all sh files with executable permission #155

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/run-scrpit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Make Shell Scripts Executable on Merge to Main

on:
push:

jobs:
make-executable:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Make all .sh files executable
run: |
find . -type f -name "*.sh" -exec chmod +x {} \;
- name: Commit and push permission changes
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add .
git diff --cached --quiet || git commit -m "Set execute permission on .sh files"
git push


1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,6 @@ The template also includes dependent resources:
### Azure Container Apps

- If your ACA does not boot up, it is possible that your deployment has failed. This could be due to quota constraints, permission issues, or resource availability. Check failures in the deployment and container app logs in the Azure Portal.

- Console traces in ACA can be found in the Azure Portal, but they may be unreliable. Use Python’s logging with INFO level, and adjust Azure HTTP logging to WARNING.
- Once your ACA is deployed, utilize the browser debugger (F12) and clear cache (CTRL+SHIFT+R). This can help debug the frontend for better traceability.

Expand Down
20 changes: 20 additions & 0 deletions scripts/setup_credential.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
# Check Azure login status
$azAccount = az account show 2>$null

if (-not $azAccount) {

Write-Host "🔐 Not logged in to Azure. Attempting to login..." -ForegroundColor Yellow
$azureTenantId = azd env get-value AZURE_TENANT_ID
az login --tenant $azureTenantId | Out-Null

if ($LASTEXITCODE -ne 0) {
Write-Host "❌ Azure login failed. Exiting script." -ForegroundColor Red
exit 1
}

Write-Host "✅ Logged in to Azure successfully." -ForegroundColor Green
} else {
$accountInfo = $azAccount | ConvertFrom-Json
Write-Host "✅ Already logged in as: $($accountInfo.user.name)" -ForegroundColor Green
}

# Prompt for username with validation
do {
$username = Read-Host -Prompt '👤 Create a new username for the web app (no spaces, at least 1 character)'
Expand Down
24 changes: 24 additions & 0 deletions scripts/setup_credential.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
#!/bin/bash

set -e

# Check if already logged in
if ! az account show &>/dev/null; then
echo -e "🔐 Not logged in to Azure. Attempting to login..."

azureTenantId=$(azd env get-value AZURE_TENANT_ID)
if [[ -z "$azureTenantId" ]]; then
echo "❌ AZURE_TENANT_ID is not set in the environment. Exiting."
exit 1
fi

az login --tenant "$azureTenantId" > /dev/null
if [[ $? -ne 0 ]]; then
echo "❌ Azure login failed. Exiting script."
exit 1
fi

echo "✅ Logged in to Azure successfully."
else
user=$(az account show --query user.name -o tsv)
echo "✅ Already logged in as: $user"
fi

templateValidationMode="${TEMPLATE_VALIDATION_MODE}"

if [[ "$templateValidationMode" == true ]]; then
Expand Down
Loading