Skip to content

Commit a242cd1

Browse files
authored
Fix cicd errors when branch creation and building all imges (#123)
Fix cicd errors when branch creation and building all imges
1 parent a605917 commit a242cd1

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

.github/workflows/build-all.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,9 @@ jobs:
5656
- name: Install Package
5757
if: steps.all.outputs.services != ''
5858
run: |
59-
DEBIAN_FRONTEND=noninteractive apt install -y python3 python-is-python3 pip git unzip docker-cli ca-certificates curl apt-transport-https lsb-release gnupg parallel
59+
DEBIAN_FRONTEND=noninteractive apt install -y python3 python-is-python3 pip git unzip ca-certificates curl apt-transport-https lsb-release gnupg parallel
6060
curl -sL https://aka.ms/InstallAzureCLIDeb | bash
61+
curl -fsSL https://get.docker.com | sh
6162
6263
- name: Install python libs
6364
if: steps.all.outputs.services != ''
@@ -78,6 +79,9 @@ jobs:
7879
mv $GITHUB_WORKSPACE/config/auth-configuration /tmp/
7980
ls -l /tmp/auth-configuration
8081
82+
- name: Log in to GHCR
83+
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
84+
8185
- name: Build Images of Services
8286
if: steps.all.outputs.services != ''
8387
run: |
@@ -86,7 +90,7 @@ jobs:
8690
echo "--------------------------------"
8791
failed_services=""
8892
for service in $all_services; do
89-
if [[ "$service" =~ alert-manager ]]; then
93+
if echo "$service" | grep -q "alert-manager"; then
9094
echo "alert-manager is in the changed services"
9195
# Build specific images in alert-manager
9296
echo "Building specific alert-manager images"

.github/workflows/build-deploy-changes.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,12 @@ jobs:
4949
base_sha=$(git merge-base origin/${{ github.event.pull_request.base.ref }} ${{ github.event.pull_request.head.sha }})
5050
head_sha="${{ github.event.pull_request.head.sha }}"
5151
else
52-
base_sha="${{ github.event.before }}"
52+
if [ "${{ github.event.before }}" = "0000000000000000000000000000000000000000" ]; then
53+
# Get the previous commit on branch
54+
base_sha=$(git rev-parse ${{ github.sha }}^)
55+
else
56+
base_sha="${{ github.event.before }}"
57+
fi
5358
head_sha="${{ github.sha }}"
5459
fi
5560

0 commit comments

Comments
 (0)