Skip to content

Discord announcement: push only when label "Needs review" is set #37

Discord announcement: push only when label "Needs review" is set

Discord announcement: push only when label "Needs review" is set #37

Workflow file for this run

name: "Announce on Discord"
on:
pull_request:
types: [ opened, reopened, labeled, review_requested ]
branches: [ main ]
jobs:
build:
name: "Announce on Discord"
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'Armbian' && contains(github.event.pull_request.labels.*.name, 'Needs review') }}
steps:
- name: Get repo
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Discord webhook
run: |
curl -i -H "Accept: application/json" -H "Content-Type: application/json" -X POST --data \
"{\"username\": \"Github\", \"avatar_url\": \"${{ secrets.AVATARURL }}\", \"content\": \"\
:arrow_heading_up: **Pull request** to [$GITHUB_REPOSITORY](<$GITHUB_SERVER_URL/$GITHUB_REPOSITORY>) by [$GITHUB_ACTOR](<$GITHUB_SERVER_URL/$GITHUB_ACTOR>) - **Please review!** \
:point_right: [Link](<$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/pull/${{github.event.pull_request.number}}>): *$(git show -s --format=%s)*\"}" ${{ secrets.WEBHOOKURL }}