Skip to content

Platform Report addition #120

Platform Report addition

Platform Report addition #120

Workflow file for this run

name: Check pull request description checkbox and send notify to Slack
on:
pull_request:
types:
- closed
env:
checkbox: "should this be added to delinea marketplace?"
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
jobs:
notify:
runs-on: ubuntu-latest
steps:
- name: Check if "should this be added to delinea marketplace?" is checked
env:
BODY: ${{ github.event.pull_request.body }}
run: |
UNCHECKED="\[ \] $checkbox"
MARKED="\[x\] $checkbox"
if echo ${BODY,,} | grep -q "$MARKED"; then
curl -X POST -H 'Content-type: application/json' --data '{"text":"New PR: ${{ github.event.pull_request.title }}${{ github.event.pull_request.html_url }} by ${{ github.actor }}"}' "$SLACK_WEBHOOK_URL"
exit 0
elif echo ${BODY,,} | grep -q "$UNCHECKED"; then
echo "Checkbox is not checked"
exit 1
else
echo "Checkbox not found in pull request description"
exit 1
fi