forked from GomuDevelopers/workflow_template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
57 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Pull Request workflow template Made for Gomu Developers OS Community | ||
on: | ||
pull_request: | ||
branches: | ||
-'*' | ||
jobs: | ||
rbuild_and_notify: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checking out the repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: setting up python environment | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.10' | ||
cache: 'pip' | ||
|
||
- name: installing and caching dependencies | ||
run: | | ||
python3 -m pip install -r requirements.txt | ||
- name: running Pull request Actions python script | ||
env: | ||
GOMU_BOT_TOKEN: ${{secrets.GOMU_BOT_TOKEN}} | ||
GOMU_CHANEL_ID: ${{secrets.GOMU_CHANEL_ID}} | ||
GITHUB_AUTHOR: ${{github.event.sender.login}} | ||
GITHUB_REPOSITORY: ${{github.repository}} | ||
GITHUB_PR_TITLE: ${{github.event.pull_request.title}} | ||
GITHUB_PR_BODY: ${{github.event.pull_request.body}} | ||
GITHUB_PR_LINK: ${{github.event.pull_request._links}} | ||
run: | | ||
python3 src/notify_on_pull_request.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from bot import send_msg | ||
import os | ||
import time | ||
|
||
|
||
def send_msg_on_PR(): | ||
author = os.environ['GITHUB_AUTHOR'] | ||
link = os.environ['GITHUB_PR_LINK'] | ||
title = os.environ['GITHUB_PR_TITLE'] | ||
body = os.environ['GITHUB_PR_BODY'] | ||
|
||
date = time.ctime() | ||
text = f"📌 Pull Request effectué par {author} 🧠 \n Date: {date} \n \n Title :{title}\n Comments: {body[:25]} ... \n sentez vous libre l'examiné {link}" | ||
send_msg(text) | ||
|
||
|
||
if __name__ == '__main__': | ||
send_msg_on_PR() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters