Compare commits

..

17 commits

Author SHA1 Message Date
21dee43f7d Merge branch 'main' into pgi-add-workflow
Some checks failed
ArgoCD Diff / argocd-diff-preview (pull_request) Failing after 24s
2026-05-29 14:13:26 +02:00
8485ce2b1f
huh
Some checks failed
ArgoCD Diff / argocd-diff-preview (pull_request) Failing after 23s
2026-05-29 12:15:45 +02:00
a5ece4f205
revert 2026-05-29 11:52:59 +02:00
f7b42cb9dd
determine changed files
Some checks failed
ArgoCD Diff / argocd-diff-preview (pull_request) Failing after 43s
2026-05-29 11:29:45 +02:00
89960102a1
trigger change
Some checks failed
ArgoCD Diff / argocd-diff-preview (pull_request) Failing after 20s
2026-05-29 11:26:25 +02:00
11281f03da
debug
Some checks failed
ArgoCD Diff / argocd-diff-preview (pull_request) Failing after 22s
2026-05-29 11:21:55 +02:00
b9311cad64
debug
Some checks failed
ArgoCD Diff / argocd-diff-preview (pull_request) Failing after 21s
2026-05-29 11:17:31 +02:00
0a617241d3
fix: parse dirs attempt 2
Some checks failed
ArgoCD Diff / argocd-diff-preview (pull_request) Failing after 21s
2026-05-29 11:15:14 +02:00
12f6f42e13 Merge branch 'main' into pgi-add-workflow
Some checks failed
ArgoCD Diff / argocd-diff-preview (pull_request) Failing after 25s
2026-05-29 11:10:04 +02:00
674a94e23e
fix: parse dirs correctly
Some checks failed
ArgoCD Diff / argocd-diff-preview (pull_request) Failing after 22s
2026-05-29 10:06:34 +02:00
4da26a2622
revert
Some checks failed
ArgoCD Diff / argocd-diff-preview (pull_request) Failing after 28s
2026-05-29 09:54:46 +02:00
453d49ffc1
fix: install deps
Some checks failed
ArgoCD Diff / argocd-diff-preview (pull_request) Failing after 25s
2026-05-29 09:43:03 +02:00
70cdc14825
maybe this works?
Some checks failed
ArgoCD Diff / argocd-diff-preview (pull_request) Failing after 4s
2026-05-29 09:41:16 +02:00
5ece983a83
fix: use non-dind image
Some checks failed
ArgoCD Diff / argocd-diff-preview (pull_request) Failing after 13s
2026-05-29 09:39:50 +02:00
f47f2d6bc2
fix: Attempt dind
Some checks failed
ArgoCD Diff / argocd-diff-preview (pull_request) Failing after 23s
2026-05-29 09:38:00 +02:00
5ac1b06c79
fix: Add Foregejo API token
Some checks failed
ArgoCD Diff / argocd-diff-preview (pull_request) Failing after 13s
2026-03-23 20:02:02 +01:00
290a5ce0c9
feat: Add ArgoCD diff workflow
Some checks failed
ArgoCD Diff / argocd-diff-preview (pull_request) Failing after 1m21s
2026-03-23 19:57:46 +01:00
2 changed files with 79 additions and 74 deletions

View file

@ -0,0 +1,79 @@
---
name: ArgoCD Diff
on:
workflow_dispatch:
workflow_call:
pull_request:
branches:
- main
jobs:
argocd-diff-preview:
runs-on: docker
container:
options: --volume /var/run/docker.sock:/var/run/docker.sock
env:
PR_NUMBER: ${{ forge.event.pull_request.number }}
GITHUB_TOKEN: ${{ secrets.FORGEJO_TOKEN }}
steps:
- uses: https://github.com/actions/checkout@v6
with:
path: pull-request
- uses: https://github.com/actions/checkout@v6
with:
ref: main
path: main
- name: Install Docker CLI
run: |
if command -v apt-get &>/dev/null; then
apt-get update -qq && apt-get install -y --no-install-recommends docker.io
elif command -v apk &>/dev/null; then
apk add --no-cache docker-cli
fi
- name: Generate Diff
run: |
CONTAINER_ID=$(docker inspect --format='{{.Id}}' "$HOSTNAME")
docker cp "$CONTAINER_ID:$(pwd)/main" /tmp/argocd-main
docker cp "$CONTAINER_ID:$(pwd)/pull-request" /tmp/argocd-pr
mkdir -p output
docker run --rm \
--network=host \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /tmp/argocd-main:/base-branch \
-v /tmp/argocd-pr:/target-branch \
-v /tmp/argocd-output:/output \
-e TARGET_BRANCH=refs/pull/$PR_NUMBER/merge \
-e REPO=${{ forge.repository }} \
dagandersen/argocd-diff-preview:v0.2.8
- name: Add comment
id: comment
run: |
DIFF_BODY=$(cat output/diff.md)
payload="{\"body\": $DIFF_BODY}"
existing_comment=$(curl -s \
-H "Authorization: token ${{ secrets.FORGEJO_TOKEN }}" \
"${{ forge.api_url }}/repos/${{ forge.repository }}/issues/$PR_NUMBER/comments")
comment_id=$(echo "$existing_comment" | jq -r \
'.[] | select(.body | test("${{ forge.workflow }}")) | .id' | head -n 1)
if [ -n "${comment_id}" ] && [ "${comment_id}" != "null" ]; then
echo "Found comment with id ${comment_id}, updating..." && \
curl -s -X PATCH \
-H "Authorization: token ${{ secrets.FORGEJO_TOKEN }}" \
-H "Content-Type: application/json" \
"${{ forge.api_url }}/repos/${{ forge.repository }}/issues/comments/${comment_id}" \
-d "$payload"
else
echo "Creating new comment..." && \
curl -s -X POST \
-H "Authorization: token ${{ secrets.FORGEJO_TOKEN }}" \
-H "Content-Type: application/json" \
"${{ forge.api_url }}/repos/${{ forge.repository }}/issues/$PR_NUMBER/comments" \
-d "$payload"
fi

View file

@ -266,77 +266,3 @@ server:
- groups - groups
rbac: rbac:
enabled: true enabled: true
# -- Array of extra K8s manifests to deploy
extraObjects:
- apiVersion: v1
kind: ServiceAccount
metadata:
name: admin-user
namespace: argo-workflows
annotations:
workflows.argoproj.io/rbac-rule: "'ArgoCD Admins' in groups"
workflows.argoproj.io/rbac-rule-precedence: "1"
- apiVersion: v1
kind: ServiceAccount
metadata:
name: read-only
namespace: argo-workflows
annotations:
workflows.argoproj.io/rbac-rule: "true"
workflows.argoproj.io/rbac-rule-precedence: "0"
- apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: argo-workflows-admin-user
subjects:
- kind: ServiceAccount
name: admin-user
namespace: argo-workflows
roleRef:
kind: ClusterRole
name: argo-workflows-admin
apiGroup: rbac.authorization.k8s.io
- apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: argo-workflows-read-only
subjects:
- kind: ServiceAccount
name: read-only
namespace: argo-workflows
roleRef:
kind: ClusterRole
name: argo-workflows-view
apiGroup: rbac.authorization.k8s.io
- apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: argo-workflows-server-sso
namespace: argo-workflows
rules:
- apiGroups:
- ""
resources:
- serviceaccounts
verbs:
- get
- apiGroups:
- ""
resources:
- serviceaccounts/token
verbs:
- create
- apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: argo-workflows-server-sso
namespace: argo-workflows
subjects:
- kind: ServiceAccount
name: argo-workflows-server
namespace: argo-workflows
roleRef:
kind: Role
name: argo-workflows-server-sso
apiGroup: rbac.authorization.k8s.io