Skip to content

Commit

Permalink
CI: Automatically create issue in CIInfra (#1123)
Browse files Browse the repository at this point in the history
Automatically create issue in CIInfra to track the changes of docker compose
files for correspdonding helm charts.

Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
  • Loading branch information
lianhao authored Jan 8, 2025
1 parent 631b570 commit 4480d80
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/push-infra-issue-creation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

on:
push:
branches: [ 'main','issue' ]
paths:
- "**/docker_compose/*.yaml"

name: Create an issue to GenAIInfra on push
jobs:
job1:
name: Create issue
runs-on: ubuntu-latest
steps:
- name: Checkout out Repo
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Get changed files
id: get-changed-files
run: |
set -xe
base_commit=$(git rev-parse HEAD~1)
merged_commit=$(git log -1 --format='%H')
changed_files="$(git diff --name-only ${base_commit} ${merged_commit} | \
grep -E '.*/docker_compose/.*\.yaml')" || true
examples=$(printf '%s\n' "${changed_files[@]}" | grep '/' | cut -d'/' -f2 | sort -u)
format_examples=$(echo "$examples" | tr '\n' ',')
format_examples=${format_examples%,}
echo "examples=$format_examples" >> $GITHUB_ENV
format_changed_files=$(echo "$changed_files" | awk '{print "- "$0}')
echo "changed_files<<EOF" >> $GITHUB_ENV
echo "$format_changed_files" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Create Issue
uses: daisy-ycguo/create-issue-action@stable
with:
token: ${{ secrets.Infra_Issue_Token }}
owner: opea-project
repo: GenAIInfra
title: |
[ci-auto] GenAIComps ${{ env.examples }} docker compose file got changed.
assignees: lianhao
labels: helm
body: |
## GenAIComps ${{ env.examples }} docker compose file got changed
Below files are changed in [this commit](https://github.com/opea-project/GenAIComps/commit/${{ github.sha }})
${{ env.changed_files }}
Please verify if the helm charts and manifests need to be changed accordingly.
> This issue was created automatically by CI.

0 comments on commit 4480d80

Please sign in to comment.