mirror of
https://github.com/PostHog/posthog.git
synced 2024-11-24 09:14:46 +01:00
f962d65242
* docs: update README.md * docs: update .all-contributorsrc * yet another ci fix Co-authored-by: posthog-contributions-bot[bot] <80958034+posthog-contributions-bot[bot]@users.noreply.github.com> Co-authored-by: yakkomajuri <yakko.majuri@gmail.com>
36 lines
1.6 KiB
YAML
36 lines
1.6 KiB
YAML
name: New PR
|
|
|
|
on:
|
|
pull_request:
|
|
types: [opened]
|
|
|
|
jobs:
|
|
check-description:
|
|
name: Check that PR has description
|
|
runs-on: ubuntu-20.04
|
|
if: ${{ github.actor != 'posthog-contributions-bot[bot]' }}
|
|
|
|
steps:
|
|
- name: Check if PR is shame-worthy
|
|
id: is-shame-worthy
|
|
run: |
|
|
FILTERED_BODY=$( \
|
|
sed -r -e \
|
|
'/^(\.\.\.)|(\*Please describe)|(\*If this affects the frontend, include screenshots)|(##? )|(- *\[)/d' \
|
|
<<< $RAW_BODY \
|
|
)
|
|
echo "::debug::Filtered PR body to $FILTERED_BODY"
|
|
if [[ -z "${FILTERED_BODY//[[:space:]]/}" ]]; then
|
|
echo "::set-output name=is-shame-worthy::true"
|
|
else
|
|
echo "::set-output name=is-shame-worthy::false"
|
|
fi
|
|
env:
|
|
RAW_BODY: ${{ github.event.pull_request.body }}
|
|
|
|
- name: Shame if PR has no description
|
|
if: steps.is-shame-worthy.outputs.is-shame-worthy == 'true'
|
|
run: |
|
|
SHAME_BODY="Hey @${{ github.actor }}! 👋\nThis pull request seems to contain no description. Please add useful context, rationale, and/or any other information that will help make sense of this change now and in the distant Mars-based future."
|
|
curl -s -u posthog-bot:${{ secrets.POSTHOG_BOT_GITHUB_TOKEN }} -X POST -d "{ \"body\": \"$SHAME_BODY\" }" "https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments"
|