Skip to content
Merged
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
31 changes: 28 additions & 3 deletions .azure/scripts/push-info-to-gh-secrets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,27 @@ set -euo pipefail
# deployed managed identity and sets them as GitHub repository secrets.
# -----------------------------------------------------------------------------

# --- Parse command line arguments ---
CI_MODE=false
while [[ $# -gt 0 ]]; do
case $1 in
--ci)
CI_MODE=true
shift
;;
-h|--help)
echo "Usage: $0 [--ci]"
echo " --ci Skip GitHub CLI authentication check (for CI/CD environments)"
exit 0
;;
*)
echo "Unknown option: $1"
echo "Use --help for usage information"
exit 1
;;
esac
done

# --- Configuration (update these to match your setup) ---
GITHUB_OWNER="MaxDac"
GITHUB_REPO="Privee"
Expand All @@ -29,9 +50,13 @@ if ! command -v gh &> /dev/null; then
exit 1
fi

if ! gh auth status > /dev/null 2>&1; then
echo "ERROR: You are not authenticated with GitHub CLI. Please run 'gh auth login'."
exit 1
if ! $CI_MODE; then
if ! gh auth status > /dev/null 2>&1; then
echo "ERROR: You are not authenticated with GitHub CLI. Please run 'gh auth login'."
exit 1
fi
else
echo "✓ Running in CI mode - skipping GitHub CLI authentication check"
fi

echo "✓ Prerequisites met"
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/azure-provision.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,17 @@ jobs:
run: |
bash ./.azure/scripts/set-secrets-to-dev-kv.sh

- name: Authenticate GitHub CLI
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh auth login --with-token <<<"$GITHUB_TOKEN"

- name: Push Azure credentials to GitHub secrets
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
bash ./.azure/scripts/push-info-to-gh-secrets.sh
bash ./.azure/scripts/push-info-to-gh-secrets.sh --ci

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
Expand Down
Loading