Skip to content

Commit 24dfeb9

Browse files
fix: monorepo by adding DEPLOYMENT_CONFIGS_APP_NAME to the PR name (#79)
1 parent 06416c7 commit 24dfeb9

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

.github/workflows/argocd-tags-ci.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,20 @@ jobs:
9696
git add -A
9797
git commit -m "${{ github.event.repository.name }}: updating ${{ inputs.ENV }} tag to $TAG, by ${{ github.actor }}"
9898
99+
100+
# Step to determine the dynamic part of the branch name
101+
- name: Set App Name Branch Part
102+
id: app_name_part
103+
run: |
104+
APP_NAME="${{ inputs.DEPLOYMENT_CONFIGS_APP_NAME }}"
105+
BRANCH_PART="" # Initialize with an empty string
106+
if [ -n "$APP_NAME" ]; then # -n checks if the string is not empty
107+
BRANCH_PART="${APP_NAME}-"
108+
fi
109+
# Set the output named 'dynamic_part'
110+
echo "dynamic_part=${BRANCH_PART}" >> "$GITHUB_OUTPUT"
111+
shell: bash
112+
99113
- name: Create PR if Desired
100114
if: ${{ inputs.CREATE_PR }}
101115
uses: peter-evans/create-pull-request@c5a7806660adbe173f04e3e038b0ccdcd758773c # v6
@@ -104,7 +118,7 @@ jobs:
104118
path: './${{ inputs.DEPLOYMENT_CONFIGS_REPO }}'
105119
title: '${{ github.event.repository.name }} [${{ inputs.ENV }}] > ${{ steps.TagRelease.outputs.TAG || steps.TagNoRelease.outputs.TAG }}'
106120
base: ${{ inputs.DEPLOYMENT_CONFIGS_REPO_DEFAULT_BRANCH }}
107-
branch: '${{ github.event.repository.name }}/update-${{ inputs.ENV }}-image-tag-${{ steps.TagRelease.outputs.TAG || steps.TagNoRelease.outputs.TAG }}'
121+
branch: '${{ github.event.repository.name }}/update-${{ steps.app_name_part.outputs.dynamic_part }}${{ inputs.ENV }}-image-tag-${{ steps.TagRelease.outputs.TAG || steps.TagNoRelease.outputs.TAG }}'
108122
body: "PR created via CI workflow in [${{ github.repository_owner }}/${{ github.event.repository.name }}](https://github.com/${{ github.repository_owner }}/${{ github.event.repository.name }}) by [${{ github.actor }}](https://github.com/${{ github.actor }})"
109123

110124
- name: Commit to Default Branch if PR not Desired

0 commit comments

Comments
 (0)