Skip to content

Commit

Permalink
chore: Add merge_group trigger for workflows (#1658)
Browse files Browse the repository at this point in the history
Co-authored-by: Korbinian Stoemmer <[email protected]>
  • Loading branch information
jeffreylimnardy and k15r authored Dec 13, 2024
1 parent 9b6b497 commit 4baa324
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .github/template/prepare-test/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ runs:
run: "./hack/await_image.sh"
env:
GITHUB_TOKEN: "${{ inputs.github-token }}"
TRIGGER: "${{ github.event.pull_request.head.sha }}"
# sets trigger depending on event being either pull_request or merge_group
TRIGGER: "${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }}"
QUERY_INTERVAL: 30
IMAGE_REPO: "europe-docker.pkg.dev/kyma-project/dev/telemetry-manager"

Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/branch-integration.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
name: Branch Integration

on:
merge_group:
branches:
- "release-*"
push:
branches:
- "main"
- "release-*"
paths-ignore:
- 'docs/**'
- 'dependencies/**'
Expand Down Expand Up @@ -34,7 +36,9 @@ jobs:
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
IMAGE_REPO: "europe-docker.pkg.dev/kyma-project/prod/telemetry-manager"
TRIGGER: "${{ github.ref_name }}"
# sets trigger to SHA if used in merge_group, but to ref_name if used in push
# even if ref_name is available in merge_group event, it will be neglected
TRIGGER: "${{ github.event.merge_group.head_sha || github.ref_name }}"
QUERY_INTERVAL: 30

# save gardener kubeconfig to a temp file in order to pass it to the command
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Build Image

on:
merge_group:
pull_request_target:
types: [opened, synchronize, reopened, ready_for_review]
branches:
Expand Down Expand Up @@ -38,6 +39,9 @@ jobs:
run: |
if [[ $GITHUB_EVENT_NAME == 'push' ]]; then
echo 'TAGS=${{ github.ref_name }}' >> "$GITHUB_OUTPUT"
elif [[ $GITHUB_EVENT_NAME == 'merge_group' ]]; then
{
echo 'TAGS=${{ github.event.merge_group.head_sha }}' >> "$GITHUB_OUTPUT"
else
{
echo 'tags<<TAGS'
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pr-all-checks-passed.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: All Checks passed
on:
merge_group:
pull_request:
types:
[
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pr-code-checks.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: PR Code Checks

on:
merge_group:
pull_request:
branches:
- "main"
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pr-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ env:
IMG: europe-docker.pkg.dev/kyma-project/dev/telemetry-manager:PR-${{ github.event.number }}

on:
merge_group:
pull_request:
branches:
- "main"
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/pr-lifecycle.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: PR Lifecycle

on:
merge_group:
pull_request:
branches:
- "main"
Expand Down Expand Up @@ -61,7 +62,8 @@ jobs:
run: "./hack/await_image.sh"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
TRIGGER: "${{ github.event.pull_request.head.sha }}"
# sets trigger depending on event being either pull_request or merge_group
TRIGGER: "${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }}"
QUERY_INTERVAL: 30
IMAGE_REPO: "europe-docker.pkg.dev/kyma-project/dev/telemetry-manager"

Expand Down

0 comments on commit 4baa324

Please sign in to comment.