From 0f3e41f79729aea89ca5e5909a3b5a1e9f0690ae Mon Sep 17 00:00:00 2001 From: Fanon Jupkwo Date: Sun, 29 May 2022 05:13:58 +0100 Subject: [PATCH 1/2] fix(notify): Update Pull Request notifications --- .../workflows/notify_on_pull_request_open.txt | 27 ------------------- .../notify_on_pull_request_open.yaml | 13 +++++++++ .../build_pull_request_notification.sh | 16 ----------- 3 files changed, 13 insertions(+), 43 deletions(-) delete mode 100644 .github/workflows/notify_on_pull_request_open.txt create mode 100644 .github/workflows/notify_on_pull_request_open.yaml delete mode 100644 .github/workflows/notify_on_pull_request_open/build_pull_request_notification.sh diff --git a/.github/workflows/notify_on_pull_request_open.txt b/.github/workflows/notify_on_pull_request_open.txt deleted file mode 100644 index 8d62250..0000000 --- a/.github/workflows/notify_on_pull_request_open.txt +++ /dev/null @@ -1,27 +0,0 @@ -name: notify of pull_request creation -on: - pull_request_target: - types: [ opened ] - branches: - - master - -jobs: - notify: - defaults: - run: - working-directory: ./.github/workflows/notify_on_pull_request_open - - name: notify - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@master - - name: notify telegram when pull request is a created - shell: bash - run: | - ./build_pull_request_notification.sh $GITHUB_EVENT_PATH > notify_on_pull_request_open_message - - name: send contribution report to osscameroon channel - uses: appleboy/telegram-action@v0.1.1 - with: - to: ${{ secrets.TELEGRAM_OSSCAMEROON_CHANNEL_ID }} - token: ${{ secrets.TELEGRAM_BOT_TOKEN }} - message_file: ./.github/workflows/notify_on_pull_request_open/notify_on_pull_request_open_message \ No newline at end of file diff --git a/.github/workflows/notify_on_pull_request_open.yaml b/.github/workflows/notify_on_pull_request_open.yaml new file mode 100644 index 0000000..88c8bd6 --- /dev/null +++ b/.github/workflows/notify_on_pull_request_open.yaml @@ -0,0 +1,13 @@ +name: notify of pull_request creation +on: + pull_request_target: + types: [ opened ] + branches: + - main + +jobs: + notify: + uses: osscameroon/global-github-actions/.github/workflows/notify_on_pull_request_open.yaml@main + secrets: + telegram_channel_id: ${{ secrets.TELEGRAM_OSSCAMEROON_CHANNEL_ID }} + telegram_token: ${{ secrets.TELEGRAM_BOT_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/notify_on_pull_request_open/build_pull_request_notification.sh b/.github/workflows/notify_on_pull_request_open/build_pull_request_notification.sh deleted file mode 100644 index d4d01d3..0000000 --- a/.github/workflows/notify_on_pull_request_open/build_pull_request_notification.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh - -FILE=$1 - -LINK=$(cat $FILE | jq '.pull_request._links.html.href' -r) -TITLE=$(cat $FILE | jq '.pull_request.title' -r) -DESCRIPTION=$(cat $FILE | jq '.pull_request.body' -r) -USER=$(cat $FILE | jq '.sender.login' -r) - -echo "A new pull request was submitted by $USER" -echo "Please check it out here $LINK" -echo "And feel free to review it" -echo "" -echo "Title: $TITLE" -echo "Description: " -echo "$DESCRIPTION" \ No newline at end of file From 84e34f17d35f8fda3004bdb0937e85307d6cf110 Mon Sep 17 00:00:00 2001 From: Fanon Jupkwo Date: Sun, 29 May 2022 05:16:36 +0100 Subject: [PATCH 2/2] Add Fanjups as codeowner --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index d40430f..0c297c1 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1 @@ -* @elroykanye @andrew21-mch @elhmn @Mankavelda +* @elroykanye @andrew21-mch @elhmn @Mankavelda @FanJups