Skip to content

Commit ee2136d

Browse files
committed
update pr diff
1 parent 18361c4 commit ee2136d

File tree

2 files changed

+23
-9
lines changed

2 files changed

+23
-9
lines changed

.github/workflows/appcd-iac-pr-diff.yml

+20-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: APPCD Diff check
22
on:
3+
push:
4+
branches:
5+
- feature/updated_gh_action
36
pull_request:
47
branches:
58
- main
@@ -8,25 +11,30 @@ jobs:
811
runs-on: ubuntu-latest
912
steps:
1013
- name: Checkout Main Branch
11-
uses: actions/checkout@v2
14+
uses: actions/checkout@v4
1215
with:
1316
ref: main
1417
path: main_branch
18+
fetch-depth: 1
1519
- name: Login to docker
1620
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin
17-
1821
- name: Generate IaC from Main Branch
1922
run: |
2023
mkdir -p artifact/main/
2124
docker run --rm \
22-
--workdir=/code \
23-
-v ./main_branch:/code -v ./artifact/main:/artifact/main ghcr.io/appcd-dev/appcd-dist/appcd@sha256:a38ade31e60f3f7f76b1135a388db158eed3c90816d5b5c09e33dd806efb67d5 \
24-
generate --mode ci --output=/artifact/main/.appcd/charts
25+
--workdir=/code \
26+
-v ./main_branch:/code \
27+
-v ./artifact/main:/artifact/main \
28+
ghcr.io/appcd-dev/appcd-dist/appcd@v0.9.0 \
29+
generate --lang Python --output=artifact/main/.appcd/charts --iac-type Helm
30+
cd artifact/main/.appcd/charts
31+
unzip DogeAPI.zip && rm DogeAPI.zip
2532
- name: Checkout PR Branch
26-
uses: actions/checkout@v2
33+
uses: actions/checkout@v4
2734
with:
2835
ref: ${{ github.head_ref }}
2936
path: pr_branch
37+
fetch-depth: 1
3038
- name: Extract branch name
3139
id: extract_branch
3240
run: echo "branch=$(basename ${{ github.head_ref}})" >> $GITHUB_OUTPUT
@@ -37,8 +45,12 @@ jobs:
3745
mkdir -p artifact/${{ steps.extract_branch.outputs.branch }}/
3846
docker run --rm \
3947
--workdir=/code \
40-
-v ./pr_branch/:/code -v ./artifact/${{ steps.extract_branch.outputs.branch }}:/artifact/${{ steps.extract_branch.outputs.branch }} ghcr.io/appcd-dev/appcd-dist/appcd@sha256:a38ade31e60f3f7f76b1135a388db158eed3c90816d5b5c09e33dd806efb67d5 \
41-
generate --mode ci --output=/artifact/${{ steps.extract_branch.outputs.branch }}/.appcd/charts
48+
-v ./pr_branch/:/code \
49+
-v ./artifact/${{ steps.extract_branch.outputs.branch }}:/artifact/${{ steps.extract_branch.outputs.branch }} \
50+
ghcr.io/appcd-dev/appcd-dist/appcd@v0.9.0 \
51+
generate --lang Python --iac-type Helm --output=artifact/${{ steps.extract_branch.outputs.branch }}/.appcd/charts
52+
cd artifact/${{ steps.extract_branch.outputs.branch }}/.appcd/charts
53+
unzip DogeAPI.zip && rm DogeAPI.zip
4254
- name: Copy infrastructure files if empty
4355
run: |
4456
cd pr_branch
@@ -51,7 +63,6 @@ jobs:
5163
git commit -m "Adds IaC dependency files"
5264
git push
5365
fi
54-
cd ../
5566
- name: Generate diff between Main and PR branch
5667
run: |
5768
mkdir -p pr_branch/deployment_files

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -174,3 +174,6 @@ dev.pem
174174
.appcd/charts/
175175
cpg.bin
176176
analyzer.log
177+
*.cpg.bin
178+
*.zip
179+
helm

0 commit comments

Comments
 (0)