Skip to content

Commit b7d965a

Browse files
Ladasclaude
andcommitted
🐛 Fix ArgoCD App State Validation workflow
- Fix curl error (exit code 23) by downloading to /tmp first - Add PR branch/repo detection for bootstrap step - Dynamically generate root-app.yaml with PR context - Use GITHUB_HEAD_REF for PR branch detection This fixes the failing CI check by: 1. Downloading ArgoCD CLI to /tmp to avoid permission issues 2. Detecting the correct PR branch and repository 3. Bootstrapping ArgoCD with the PR's repo/branch 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent bb7b9d3 commit b7d965a

File tree

1 file changed

+39
-4
lines changed

1 file changed

+39
-4
lines changed

.github/workflows/app-state-validation.yml

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,10 @@ jobs:
8787
8888
- name: Install ArgoCD CLI
8989
run: |
90-
curl -sSL -o argocd https://github.com/argoproj/argo-cd/releases/download/${{ env.ARGOCD_VERSION }}/argocd-linux-amd64
90+
cd /tmp
91+
curl -fsSL -o argocd "https://github.com/argoproj/argo-cd/releases/download/${{ env.ARGOCD_VERSION }}/argocd-linux-amd64"
9192
chmod +x argocd
92-
sudo mv argocd /usr/local/bin/
93+
sudo mv argocd /usr/local/bin/argocd
9394
argocd version --client
9495
9596
- name: Create Kind cluster
@@ -107,8 +108,42 @@ jobs:
107108
- name: Bootstrap ArgoCD applications
108109
if: steps.cluster_mode.outputs.mode == 'kind'
109110
run: |
110-
chmod +x ./scripts/kind/03-bootstrap-apps.sh
111-
./scripts/kind/03-bootstrap-apps.sh
111+
# Dynamically generate root-app.yaml with PR repo/branch
112+
DEPLOY_REPO="https://github.com/${{ github.repository }}"
113+
DEPLOY_BRANCH="${GITHUB_HEAD_REF:-${GITHUB_REF_NAME}}"
114+
115+
echo "Bootstrapping with:"
116+
echo " Repository: ${DEPLOY_REPO}"
117+
echo " Branch: ${DEPLOY_BRANCH}"
118+
119+
cat > /tmp/root-app.yaml <<EOF
120+
apiVersion: argoproj.io/v1alpha1
121+
kind: Application
122+
metadata:
123+
name: kagenti-platform-kind
124+
namespace: argocd
125+
finalizers:
126+
- resources-finalizer.argocd.argoproj.io
127+
spec:
128+
project: default
129+
source:
130+
repoURL: ${DEPLOY_REPO}
131+
targetRevision: ${DEPLOY_BRANCH}
132+
path: argocd/applications/kind-local
133+
destination:
134+
server: https://kubernetes.default.svc
135+
namespace: argocd
136+
syncPolicy:
137+
automated:
138+
prune: true
139+
selfHeal: true
140+
syncOptions:
141+
- CreateNamespace=true
142+
EOF
143+
144+
kubectl apply -f /tmp/root-app.yaml
145+
sleep 5
146+
kubectl get applications -n argocd
112147
113148
- name: Wait for ArgoCD to be ready
114149
if: steps.cluster_mode.outputs.mode == 'kind'

0 commit comments

Comments
 (0)