Skip to content

Commit 4178693

Browse files
committed
🐛(ci) use github action for argocd webhook notification
In order to refactor this notification between alls projetcs, we choose to use a custom github action
1 parent 53be6de commit 4178693

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

.github/workflows/docker-hub.yml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,9 @@ jobs:
127127
runs-on: ubuntu-latest
128128
if: github.event_name != 'pull_request'
129129
steps:
130-
-
131-
name: Checkout repository
132-
uses: actions/checkout@v4
133-
-
134-
name: Call argocd github webhook
135-
run: |
136-
data='{"ref": "'$GITHUB_REF'","repository": {"html_url":"'$GITHUB_SERVER_URL'/${{ secrets.DEPLOYMENT_REPO_URL }}"}}'
137-
sig=$(echo -n ${data} | openssl dgst -sha256 -hmac "${{ secrets.ARGOCD_PREPROD_WEBHOOK_SECRET }}" | awk '{print "X-Hub-Signature-256: sha256="$2}')
138-
curl -X POST -H 'X-GitHub-Event:push' -H "Content-Type: application/json" -H "${sig}" --data "${data}" ${{ vars.ARGOCD_PREPROD_WEBHOOK_URL }}
130+
- uses: numerique-gouv/action-argocd-webhook-notification@main
131+
id: notify
132+
with:
133+
deployment_repo_path: "${{ secrets.DEPLOYMENT_REPO_URL }}"
134+
argocd_webhook_secret: "${{ secrets.ARGOCD_PREPROD_WEBHOOK_SECRET }}"
135+
argocd_url: "${{ vars.ARGOCD_PREPROD_WEBHOOK_URL }}"

0 commit comments

Comments
 (0)