-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Add workflow to trigger CoC violation analysis #1061
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Nitin Ramchandani <nitin.ramchandani@ibm.com>
pull_request_number=$(jq --raw-output '.workflow_run.pull_requests[0].number' "$GITHUB_EVENT_PATH") | ||
github_org=$(echo ${{ github.repository }} | cut -d "/" -f 1) | ||
repo_name=$(echo ${{ github.repository }} | cut -d "/" -f 2) | ||
curl -X 'POST' "https://pr-analysis-handler.1fuhf5gskmng.us-east.codeengine.appdomain.cloud/analyze-pr?pr_number=${pull_request_number}&owner=${github_org}&repo=${repo_name}" -H 'accept: application/json' -H 'Authorization: Bearer ${{ secrets.COC_ANALYSIS_TOKEN }}' -d '' & |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
curl -X 'POST' "https://pr-analysis-handler.1fuhf5gskmng.us-east.codeengine.appdomain.cloud/analyze-pr?pr_number=${pull_request_number}&owner=${github_org}&repo=${repo_name}" -H 'accept: application/json' -H 'Authorization: Bearer ${{ secrets.COC_ANALYSIS_TOKEN }}' -d '' & | |
curl -X 'POST' "https://pr-analysis-handler.1fuhf5gskmng.us-east.codeengine.appdomain.cloud/analyze-pr?pr_number=${{ github.event.workflow_run.pull_requests[0].number }}&owner=${{ github.event.organization }}&repo=${{ github.event.repository }}" -H 'accept: application/json' -H 'Authorization: Bearer ${{ secrets.COC_ANALYSIS_TOKEN }}' -d '' & |
I think this is slightly cleaner as it does not require any shell commands.
See https://docs.github.com/en/webhooks/webhook-events-and-payloads#workflow_run
@@ -0,0 +1,21 @@ | |||
name: CoC violation analysis |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name: CoC violation analysis | |
# SPDX-License-Identifier: Apache-2.0 | |
name: CoC violation analysis |
workflows: [Lint] | ||
types: | ||
- completed | ||
jobs: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jobs: | |
env: | |
LC_ALL: en_US.UTF-8 | |
defaults: | |
run: | |
shell: bash | |
permissions: | |
contents: read | |
jobs: |
pull_request_number=$(jq --raw-output '.workflow_run.pull_requests[0].number' "$GITHUB_EVENT_PATH") | ||
github_org=$(echo ${{ github.repository }} | cut -d "/" -f 1) | ||
repo_name=$(echo ${{ github.repository }} | cut -d "/" -f 2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pull_request_number=$(jq --raw-output '.workflow_run.pull_requests[0].number' "$GITHUB_EVENT_PATH") | |
github_org=$(echo ${{ github.repository }} | cut -d "/" -f 1) | |
repo_name=$(echo ${{ github.repository }} | cut -d "/" -f 2) |
run-name: Running CoC violation analysis | ||
on: | ||
workflow_run: | ||
workflows: [Lint] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
workflows: [Lint] | |
workflows: | |
- Lint |
I guess this got merged before my review was complete. I'll make a new PR. |
Yep, we wanted to test this ASAP, so I went ahead and merged it. I had to put the SECRET in and all and the only way was to get it merged. |
Adding workflow to trigger CoC analysis, post `Lint` workflow is successful. CoC analysis validates the contribution yml files against the following areas: - Privacy (Personal Identifiable Information) - HAP (Hate, Abuse, Profanity) - Inappropriate Content (Adult, Illegal, Gambling) - Regulated Industries (Medical, Financial) Signed-off-by: Nitin Ramchandani <nitin.ramchandani@ibm.com> Signed-off-by: “David <dalowe@gmail.com>
Adding workflow to trigger CoC analysis, post `Lint` workflow is successful. CoC analysis validates the contribution yml files against the following areas: - Privacy (Personal Identifiable Information) - HAP (Hate, Abuse, Profanity) - Inappropriate Content (Adult, Illegal, Gambling) - Regulated Industries (Medical, Financial) Signed-off-by: Nitin Ramchandani <nitin.ramchandani@ibm.com> Signed-off-by: JDWilson <reformanda@users.noreply.github.com>
Adding workflow to trigger CoC analysis, post `Lint` workflow is successful. CoC analysis validates the contribution yml files against the following areas: - Privacy (Personal Identifiable Information) - HAP (Hate, Abuse, Profanity) - Inappropriate Content (Adult, Illegal, Gambling) - Regulated Industries (Medical, Financial) Signed-off-by: Nitin Ramchandani <nitin.ramchandani@ibm.com> Signed-off-by: b4d <b4d@sablun.org>
Adding workflow to trigger CoC analysis, post `Lint` workflow is successful. CoC analysis validates the contribution yml files against the following areas: - Privacy (Personal Identifiable Information) - HAP (Hate, Abuse, Profanity) - Inappropriate Content (Adult, Illegal, Gambling) - Regulated Industries (Medical, Financial) Signed-off-by: Nitin Ramchandani <nitin.ramchandani@ibm.com>
Adding workflow to trigger CoC analysis, post `Lint` workflow is successful. CoC analysis validates the contribution yml files against the following areas: - Privacy (Personal Identifiable Information) - HAP (Hate, Abuse, Profanity) - Inappropriate Content (Adult, Illegal, Gambling) - Regulated Industries (Medical, Financial) Signed-off-by: Nitin Ramchandani <nitin.ramchandani@ibm.com>
Adding workflow to trigger CoC analysis, post
Lint
workflow is successful.CoC analysis validates the contribution yml files against the following areas: