Skip to content

Commit

Permalink
[dev-v2.10] auto bump trigger (#4853)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasSUSE authored Dec 12, 2024
1 parent e1c44de commit 2759f5f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/auto-bump.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,22 @@ jobs:

- name: Log Event Payload
run: |
echo "Raw Payload: ${{ github.event.inputs.payload }}"
echo "Raw Payload: ${{ github.event.inputs.eventPayload }}"
- name: Parse JSON Payload
id: parse_payload
run: |
echo '${{ github.event.inputs.payload }}' | jq -r '.package, .branch' | {
read package
echo '${{ github.event.inputs.eventPayload }}' | jq -r '.chart, .branch' | {
read chart
read branch
echo "PACKAGE=$package" >> $GITHUB_ENV
echo "CHART=$chart" >> $GITHUB_ENV
echo "BRANCH=$branch" >> $GITHUB_ENV
}
- name: make chart-bump
run: |
echo "make chart-bump package=${{ env.PACKAGE }} branch=${{ env.BRANCH }}"
make chart-bump package="${{ env.PACKAGE }}" branch="${{ env.BRANCH }}"
echo "make chart-bump package=${{ env.CHART }} branch=${{ env.BRANCH }}"
make chart-bump package="${{ env.CHART }}" branch="${{ env.BRANCH }}"
- name: Configure Git for Commit
run: |
Expand All @@ -42,10 +42,10 @@ jobs:
- name: Git Add, Commit, Push Changes
run: |
git add .
git commit -m "Auto bump chart version for ${PACKAGE}"
git commit -m "Auto bump chart version for ${env.CHART}"
git push origin ${{ env.BRANCH }}
- name: Create Pull Request
run: |
gh auth login --with-token < ${{ secrets.GITHUB_TOKEN }}
gh pr create --base ${{ env.BRANCH }} --head ${{ github.sha }} --title "[${env.BRANCH}] auto bump: ${PACKAGE}" --body "This PR auto-bumps the chart version for ${PACKAGE}"
gh pr create --base ${{ env.BRANCH }} --head ${{ github.sha }} --title "[${env.BRANCH}] auto bump: ${env.CHART}" --body "This PR auto-bumps the chart version for ${env.CHART}"
13 changes: 8 additions & 5 deletions .github/workflows/test-trigger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,18 @@ name: trigger-test
on:
workflow_dispatch:
inputs:
payload:
description: "Mock payload for testing"
chart:
description: "Chart name"
required: true
default: '{"package": "example-chart", "branch": "main"}'
default: "example-chart"
branch:
description: "Branch name (only dev branches)"
required: true
default: "dev-v2.10"


jobs:
auto-bump:
uses: ./.github/workflows/auto-bump.yaml
with:
eventPayload: ${{ github.event.inputs.payload }}

eventPayload: '{"chart": "${{ github.event.inputs.chart }}", "branch": "${{ github.event.inputs.branch }}"}'

0 comments on commit 2759f5f

Please sign in to comment.