Skip to content

Commit

Permalink
add workflow to detect internal config changes
Browse files Browse the repository at this point in the history
Signed-off-by: hlts2 <[email protected]>
  • Loading branch information
hlts2 committed Jul 24, 2023
1 parent d033c01 commit cb440fb
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/detect-internal-config-changes.yml
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 }}

0 comments on commit cb440fb

Please sign in to comment.