Checklist:
Describe the bug
When Argo CD Notifications publishes GitHub commit statuses, an on-sync-failed notification cannot be completed if the Application fails early during manifest generation or comparison.
The failure trigger is evaluated correctly:
app.status.operationState.phase = Error
and the notifications controller reports:
Trigger 'on-sync-failed' TRIGGERED
However, for this type of early failure:
app.status.operationState.syncResult.revision
is empty.
If the GitHub notification template uses that field as revisionPath, the controller attempts to call the GitHub commit status endpoint without a revision:
POST https://api.github.com/repos/example-org/example-repo/statuses/
GitHub then returns:
The same notification configuration works when a sync succeeds because syncResult.revision contains the resolved Git revision.
To Reproduce
-
Configure Argo CD Notifications with the GitHub notification service.
-
Configure a failure template:
template.app-reconciled-failed: |
github:
repoURLPath: "{{.app.spec.source.repoURL}}"
revisionPath: "{{.app.status.operationState.syncResult.revision}}"
status:
state: failure
label: "continuous-delivery/{{.app.metadata.name}}"
- Configure the
on-sync-failed trigger:
trigger.on-sync-failed: |
- description: Application sync failed
when: app.status.operationState.phase in ['Error', 'Failed']
send:
- app-reconciled-failed
-
Create an Application that tracks a Git repository.
-
Commit a manifest that causes manifest generation to fail before a sync result is produced. For example:
apiVersion: apps/v1
kind: Deployment
metadata:
name: example-app
annotations:
example.com/invalid-annotation:
spec:
selector:
matchLabels:
app: example-app
template:
metadata:
labels:
app: example-app
spec:
containers:
- name: example
image: nginx
-
Reconcile or sync the Application.
-
Observe that the Application reaches a state similar to:
Operation phase : Error
Sync status : Unknown
Sync revision : <branch-name>
Requested revision :
Result revision :
- Observe the notifications controller logs:
Trigger 'on-sync-failed' TRIGGERED | revision: | templates:
[app-reconciled-failed]
Sending notification about condition 'on-sync-failed.[0]...' to '{github }'
Failed to notify recipient {github }:
POST https://api.github.com/repos/example-org/example-repo/statuses/: 404 Not Found []
Expected behavior
When on-sync-failed is triggered because an Application fails during manifest generation or comparison, the GitHub commit status notification should still be able to associate the failure with the Git revision that caused the reconciliation.
At minimum, the notification controller should not issue a GitHub commit status request with an empty revision.
Screenshots
Not required for reproduction.
Version
argocd: v3.0.5+af9ebac
BuildDate: 2025-05-29T18:05:04Z
GitCommit: af9ebac0bb35dc16eb034c1cefaf7c92d1029927
GitTreeState: clean
GoVersion: go1.24.1
Compiler: gc
Platform: windows/amd64
argocd-server: v3.5.2
Logs
Trigger 'on-deployed' FAILED | revision: | templates:
[app-reconciled]
Trigger 'on-sync-failed' TRIGGERED | revision: | templates:
[app-reconciled-failed]
Sending notification about condition 'on-sync-failed.[0]...' to '{github }'
Failed to notify recipient {github }:
POST https://api.github.com/repos/example-org/example-repo/statuses/: 404 Not Found []
Processing completed
Relevant Application state:
Operation phase : Error
Sync status : Unknown
Sync revision : <branch-name>
Requested revision :
Result revision :
Relevant condition:
ComparisonError
Failed to load target state: failed to generate manifest for source 1 of 1:
manifest generation error caused by an invalid non-string/null annotation value.
Checklist:
argocd version.Describe the bug
When Argo CD Notifications publishes GitHub commit statuses, an
on-sync-failednotification cannot be completed if the Application fails early during manifest generation or comparison.The failure trigger is evaluated correctly:
and the notifications controller reports:
However, for this type of early failure:
is empty.
If the GitHub notification template uses that field as
revisionPath, the controller attempts to call the GitHub commit status endpoint without a revision:GitHub then returns:
The same notification configuration works when a sync succeeds because
syncResult.revisioncontains the resolved Git revision.To Reproduce
Configure Argo CD Notifications with the GitHub notification service.
Configure a failure template:
on-sync-failedtrigger:Create an Application that tracks a Git repository.
Commit a manifest that causes manifest generation to fail before a sync result is produced. For example:
Reconcile or sync the Application.
Observe that the Application reaches a state similar to:
Expected behavior
When
on-sync-failedis triggered because an Application fails during manifest generation or comparison, the GitHub commit status notification should still be able to associate the failure with the Git revision that caused the reconciliation.At minimum, the notification controller should not issue a GitHub commit status request with an empty revision.
Screenshots
Not required for reproduction.
Version
Logs
Relevant Application state:
Relevant condition: