-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add workflow to detect internal config changes
Signed-off-by: hlts2 <[email protected]>
- Loading branch information
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: "Detect internal config changes" | ||
|
||
on: | ||
|
||
# TODO: Delete it later. | ||
push: | ||
branches: | ||
- "add-dump-action" | ||
|
||
jobs: | ||
dump_contexts_to_log: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ./.github/actions/dump-context | ||
|
||
warning: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Warn | ||
run: | | ||
PR_COMMENTS=`curl ${API_URL}?per_page=10000` | ||
BODY=`echo -E $PR_COMMENTS | jq 'last(.[] | select(.user.login == "vdaas-ci") | select(.body | test("^\\\\*\\\\*\\\\[WARNING:INTCFG")) | .body)' -r` | ||
if [ "$BODY" = "null" ]; then | ||
curl --include --verbose --fail \ | ||
-H "Accept: application/json" \ | ||
-H "Content-Type:application/json" \ | ||
-H "Authorization: token ${GITHUB_TOKEN}" \ | ||
--request POST \ | ||
--data "{\"body\": \"**[WARNING:INTCFG]** Changes in \`interal/config\` may require you to change Helm charts. Please check.\"}" \ | ||
${API_URL} | ||
fi | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.DISPATCH_TOKEN }} | ||
API_URL: ${{ github.event.pull_request.comments_url }} | ||
PR_USER: ${{ github.event.pull_request.user.login }} | ||
PR_NUM: ${{ github.event.issue.number }} |