From a1d90f8cddfba71a13bcdb98211e10d3d4b8cd83 Mon Sep 17 00:00:00 2001 From: Nicolas GERARD Date: Sat, 24 Aug 2024 18:20:24 +0200 Subject: [PATCH] Deploy on push - Get HEAD commit updated --- .github/workflows/deploy.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index c5f8a149..fd4fc820 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -19,7 +19,9 @@ jobs: uses: actions/checkout@v3 - name: Get the last commit hash on main - run: echo "LAST_COMMIT=$(git rev-parse origin/main)" >> $GITHUB_ENV + run: | + set -Eeuo pipefail + echo "LAST_COMMIT=$(git rev-parse HEAD)" >> $GITHUB_ENV - name: Check out the deploy repository uses: actions/checkout@v3 @@ -32,6 +34,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.ARGOCD_GITHUB_TOKEN }} run: | + set -Eeuo pipefail cd kube-argocd || echo 'Fail Cd' & exit 1 echo "Patch Deployment with the last commit ($LAST_COMMIT)" # Patch with the last commit the app deployment