-
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.
Create an action to prepare SOFA dev meeting template for notes (miss…
…ing new files)
- Loading branch information
Showing
2 changed files
with
70 additions
and
0 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,36 @@ | ||
name: Post - SOFA dev meeting report template | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '0 6 * * 3' # 7:00 am UTC+1 on Wednesdays | ||
|
||
jobs: | ||
run: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.12' | ||
|
||
- name: Install pip packages | ||
run: | | ||
pip install python-graphql-client | ||
pip install python-dateutil | ||
pip install requests | ||
working-directory: ${{ github.workspace }} | ||
|
||
- name: Run script SOFA-dev-meeting-template.py | ||
if: github.event.schedule != '0 0 15 * *' | ||
run: | | ||
python SOFA-dev-meeting/SOFA-dev-meeting-template.py | ||
working-directory: ${{ github.workspace }} | ||
env: | ||
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_SOFADEV_WEBHOOK_URL }} | ||
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }} |
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 @@ | ||
from github import Github | ||
import os | ||
|
||
def list_topics_to_be_discussed(repo_name): | ||
# Example usage | ||
repo_owner = "sofa-framework" | ||
if "GITHUB_TOKEN" in os.environ: | ||
github_token = os.environ['GITHUB_TOKEN'] | ||
else: | ||
print("GITHUB_TOKEN environment variable is missing.") | ||
sys.exit(1) | ||
|
||
# Create a GitHub instance | ||
github = Github(github_token) | ||
|
||
# Get the repository | ||
repository = github.get_repo(f"{repo_owner}/{repo_name}") | ||
|
||
message = "" | ||
|
||
# ------------------------------------------------ | ||
|
||
# Get all open issues (and PR, since PR are compatible with issues for GitHub) | ||
issues = repository.get_issues(state='open') | ||
|
||
# Iterate over each issues | ||
for issue in issues: | ||
# Check if the issue has the label "pr: status to review" | ||
if any(label.name == 'pr: dev meeting topic' for label in issue.labels): | ||
message = message + "- [#"+str(issue.number)+" "+str(issue.title)+"]("+str(issue.html_url)+")\n" | ||
|
||
# ------------------------------------------------ | ||
|
||
return message |