forked from opea-project/GenAIExamples
-
Notifications
You must be signed in to change notification settings - Fork 2
59 lines (49 loc) · 1.92 KB
/
push-infra-issue-creation.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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'/' -f1 | 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] GenAIExample ${{ env.examples }} compose.yaml got changed.
assignees: lianhao
labels: helm
body: |
## GenAIExample ${{ env.examples }} compose.yaml got changed
Below files are changed in [this commit](https://github.com/opea-project/GenAIExamples/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.