From 77e6c9c8ef2b5eb3028d7254808efc618f064135 Mon Sep 17 00:00:00 2001 From: Werner Date: Sun, 11 Aug 2024 09:29:12 +0200 Subject: [PATCH] Send summaries of PR and merges to main chat (#7060) * Create pr-announce.yml * Rename pr-announce.yml to pr-announce.yml * Create merge-announce.yml --- .github/workflows/merge-announce.yml | 20 ++++++++++++++++++++ .github/workflows/pr-announce.yml | 18 ++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 .github/workflows/merge-announce.yml create mode 100644 .github/workflows/pr-announce.yml diff --git a/.github/workflows/merge-announce.yml b/.github/workflows/merge-announce.yml new file mode 100644 index 000000000..7b53e680b --- /dev/null +++ b/.github/workflows/merge-announce.yml @@ -0,0 +1,20 @@ +name: push + +on: + push: + branches: [ main ] + +jobs: + announcepush: + runs-on: ubuntu-latest + steps: + - name: Get repo + uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} + - name: Send push to Discord + run: | + curl -i -H "Accept: application/json" -H "Content-Type: application/json" -X POST --data \ + "{\"username\": \"Github\", \"avatar_url\": \"${{ secrets.AVATARURL }}\", \"content\": \"\ + :white_check_mark: **Merged** into [$GITHUB_REPOSITORY](<$GITHUB_SERVER_URL/$GITHUB_REPOSITORY>) by [$GITHUB_ACTOR](<$GITHUB_SERVER_URL/$GITHUB_ACTOR>) - \ + [Link](<$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/commit/$GITHUB_SHA>): *$(git show -s --format=%s)*\"}" ${{ secrets.WEBHOOKURL }} diff --git a/.github/workflows/pr-announce.yml b/.github/workflows/pr-announce.yml new file mode 100644 index 000000000..c03cdf9da --- /dev/null +++ b/.github/workflows/pr-announce.yml @@ -0,0 +1,18 @@ +on: + pull_request: + branches: [ main ] + +jobs: + build: + runs-on: ubuntu-latest + 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/commit/$GITHUB_SHA>): *$(git show -s --format=%s)*\"}" ${{ secrets.WEBHOOKURL }}