-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (41 loc) · 1.26 KB
/
diff.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: Argo CD
on:
pull_request:
branches:
- master
jobs:
diff:
name: Differences
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: clowdhaus/argo-cd-action@v2.2.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
command: version
options: --client
- name: Gather differences in the app of apps
env:
ARGOCD_AUTH_TOKEN: ${{ secrets.ARGOCD_AUTH_TOKEN }}
run: |
echo '```diff' > diff.txt
set +e -o pipefail
argocd app diff app-of-apps --revision ${{ github.sha }} \
--server ${{ vars.ARGOCD_SERVER }} --grpc-web | tee -a diff.txt
status="$?"
echo '```' >> diff.txt
set -e
if [ "$status" -ne 0 ] && [ "$status" -ne 1 ]; then
echo "A failure happened while running the app diff command." > diff.txt
exit 1
elif [ "$status" -eq 0 ]; then
echo "No differences found in the app of apps." > diff.txt
fi
- name: Comment results on the pull request
uses: thollander/actions-comment-pull-request@v2
with:
filePath: diff.txt