From 93ca4f2bf460972c522fce6b1c78df78ef67a739 Mon Sep 17 00:00:00 2001 From: Jacques ROUSSEL Date: Fri, 28 Mar 2025 14:13:12 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B(ci)=20use=20github=20action=20for?= =?UTF-8?q?=20argocd=20webhook=20notification?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In order to refactor this notification between alls projetcs, we chooseto use a custom github action --- .github/workflows/docker-hub.yml | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/docker-hub.yml b/.github/workflows/docker-hub.yml index 2a53af19..1afab6e9 100644 --- a/.github/workflows/docker-hub.yml +++ b/.github/workflows/docker-hub.yml @@ -119,12 +119,9 @@ jobs: runs-on: ubuntu-latest if: github.event_name != 'pull_request' steps: - - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Call argocd github webhook - run: | - data='{"ref": "'$GITHUB_REF'","repository": {"html_url":"'$GITHUB_SERVER_URL'/numerique-gouv/lasuite-deploiement"}}' - sig=$(echo -n ${data} | openssl dgst -sha1 -hmac "${{ secrets.ARGOCD_PREPROD_WEBHOOK_SECRET }}" | awk '{print "X-Hub-Signature: sha1="$2}') - curl -X POST -H 'X-GitHub-Event:push' -H "Content-Type: application/json" -H "${sig}" --data "${data}" ${{ vars.ARGOCD_PREPROD_WEBHOOK_URL }} + - uses: numerique-gouv/action-argocd-webhook-notification@main + id: notify + with: + deployment_repo_path: "${{ secrets.DEPLOYMENT_REPO_URL }}" + argocd_webhook_secret: "${{ secrets.ARGOCD_PREPROD_WEBHOOK_SECRET }}" + argocd_url: "${{ vars.ARGOCD_PREPROD_WEBHOOK_URL }}"