https://github.com/jetbrains-space-infra/actions-argocd-diff
A repository for hosting a centralised library of GitHub Actions
https://github.com/jetbrains-space-infra/actions-argocd-diff
actions argocd automation github
Last synced: 2 months ago
JSON representation
A repository for hosting a centralised library of GitHub Actions
- Host: GitHub
- URL: https://github.com/jetbrains-space-infra/actions-argocd-diff
- Owner: jetbrains-space-infra
- License: apache-2.0
- Created: 2025-08-07T07:38:31.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-11-06T13:35:45.000Z (8 months ago)
- Last Synced: 2025-11-06T15:23:30.688Z (8 months ago)
- Topics: actions, argocd, automation, github
- Language: Shell
- Homepage:
- Size: 14.6 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ๐ Argo CD Diff GitHub Action
This GitHub Action runs `argocd app diff` for all applications in a specified Argo CD project and outputs a **Markdown-formatted summary**, useful for visibility in CI pipelines or PR checks.
You can use this action to detect configuration drift, review changes between git revisions, or simply preview what Argo CD would apply.
---
## ๐ฆ Features
- ๐ Runs `argocd app diff` on all apps in a project
- ๐งพ Outputs Markdown report as an action output (`result`)
- ๐ Stores the report in a file (`argocd-diff-summary.XXXXXX.md`) and returns its name (`filename`)
- ๐งฐ Based on official `quay.io/argoproj/argocd` CLI image
- โ๏ธ Supports version pinning for Argo CD CLI
---
## ๐ฅ Inputs
| Name | Description | Required | Default |
|-------------------|--------------------------------------------|----------|-------------|
| `argocd-version` | Argo CD CLI version | โ | `v3.0.12` |
| `server` | Argo CD server URL | โ
| โ |
| `project` | Argo CD project name | โ
| โ |
| `token` | Argo CD authentication token | โ
| โ |
| `revision` | Git revision to diff against | โ
| โ |
---
## ๐ค Outputs
| Name | Description |
|------------|-------------------------------------------|
| `result` | Markdown-formatted diff result |
| `filename` | Name the generated `argocd-diff-summary.XXXXXX.md` file |
---
## ๐ Usage
```yaml
jobs:
argo-diff:
runs-on: ubuntu-latest
steps:
- uses: jetbrains-space-infra/actions-argocd-diff@v1
id: diff
with:
server: https://your-argocd.example.com
project: my-argo-project
token: ${{ secrets.ARGOCD_AUTH_TOKEN }}
revision: ${{ github.head_ref }}
- name: Show raw diff
run: echo "${{ steps.diff.outputs.result }}"
- name: Upload report as artifact
uses: actions/upload-artifact@v4
with:
name: argocd-diff
path: "${{ github.workspace }}/${{ steps.diff.outputs.filename }}"
```
---
### ๐ Notes
- The `token` must be a valid **Argo CD API token** (usually generated via `argocd account generate-token`).
- It must have access to:
- `argocd app list`
- `argocd app diff`
- all applications in the specified `project`.
- If Argo CD has SSO enabled, ensure the token is from a bot or local user with appropriate permissions.
---
### ๐ ๏ธ Local Development & Debugging
To test locally with a specific version of Argo CD:
```bash
docker build --build-arg ARGOCD_VERSION=v3.0.12 -t argocd-diff-action .
docker run --rm \
-e INPUT_SERVER=https://argocd.example.com \
-e INPUT_PROJECT=my-project \
-e INPUT_TOKEN=your-token \
-e INPUT_REVISION=main \
argocd-diff-action
```
Youโll get the rendered Markdown in argocd-diff-summary.XXXXXX.md inside the container.