Skip to content

Commit

Permalink
Create an action to prepare SOFA dev meeting template for notes (miss…
Browse files Browse the repository at this point in the history
…ing new files)
  • Loading branch information
hugtalbot committed Nov 7, 2024
1 parent 8b5415c commit 8a84777
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/post-sofa-dev-template.yml
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 }}
34 changes: 34 additions & 0 deletions SOFA-dev-meeting/list_topics_to_be_discussed.py
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

0 comments on commit 8a84777

Please sign in to comment.