Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update chart-update.yml workflow to track EE version #445

Merged
merged 1 commit into from
Oct 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions .github/workflows/chart-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,10 @@ jobs:
working-directory: stable
id: update_version
run: |
HZ_REPO="hazelcast/hazelcast"
echo ${{ env.DEVOPS_GITHUB_TOKEN }} | gh auth login --with-token
HZ_REPO="hazelcast/hazelcast-mono"
MC_REPO="hazelcast/management-center"
paths=("hazelcast" "hazelcast-enterprise")
paths=("hazelcast-enterprise")

# Function to extract a specific field value from a YAML file
extract_version() {
Expand Down Expand Up @@ -156,19 +157,28 @@ jobs:
fi
echo "TITLE=$TITLE" >> $GITHUB_ENV
echo "BRANCH=$BRANCH" >> $GITHUB_ENV

PR_NUMBER=$(gh pr list --repo ${GITHUB_REPOSITORY} --search "$TITLE" --json number | jq -r '.[].number')
if [[ -z "$PR_NUMBER" ]]; then
echo "PR_EXIST=false" >> $GITHUB_OUTPUT
echo "PR_EXIST=false" >> $GITHUB_ENV
fi

- name: Commit and Push Changes
if: (steps.update_version.outputs.HZ_UPDATED == 'true' || steps.update_version.outputs.MC_UPDATED == 'true')
if: (steps.update_version.outputs.HZ_UPDATED == 'true' || steps.update_version.outputs.MC_UPDATED == 'true') && steps.title.outputs.PR_EXIST == 'false'
run: |
git config user.email "[email protected]"
git config user.name "devOpsHelm"
git fetch origin
git checkout master
git pull origin master
git checkout -b ${{ env.BRANCH }}
git add .
git commit --signoff -m "${{ env.TITLE }}"
git push -u origin ${{ env.BRANCH }}

- name: Create PR to Main Branch
if: (steps.update_version.outputs.HZ_UPDATED == 'true' || steps.update_version.outputs.MC_UPDATED == 'true')
if: (steps.update_version.outputs.HZ_UPDATED == 'true' || steps.update_version.outputs.MC_UPDATED == 'true') && steps.title.outputs.PR_EXIST == 'false'
run: |
echo ${{ env.DEVOPS_GITHUB_TOKEN }} | gh auth login --with-token
gh pr create --fill \
Expand Down
Loading