Skip to content

Commit

Permalink
Update Daily_GitHub_Issues_Report.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
cristianosticca-pagopa authored Jun 13, 2024
1 parent 4f67721 commit 35e8410
Showing 1 changed file with 34 additions and 7 deletions.
41 changes: 34 additions & 7 deletions .github/workflows/Daily_GitHub_Issues_Report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,23 +43,50 @@ jobs:
echo " }" >> script.py
echo " response = requests.get(GITHUB_API_URL, headers=headers)" >> script.py
echo " issues = response.json()" >> script.py
echo " return [issue for issue in issues if not issue['labels']]" >> script.py
echo " return [issue for issue in issues if not issue.get('labels') and 'pull_request' not in issue]" >> script.py
echo "" >> script.py
echo "def create_slack_message(issues):" >> script.py
echo " today = datetime.now().strftime('%Y-%m-%d')" >> script.py
echo " message = {" >> script.py
echo " 'text': f'Issue Report for {today}'," >> script.py
echo " 'blocks': []" >> script.py
echo " 'blocks': [" >> script.py
echo " {" >> script.py
echo " 'type': 'section'," >> script.py
echo " 'text': {" >> script.py
echo " 'type': 'mrkdwn'," >> script.py
echo " 'text': '*Buongiorno, queste sono le issue github aperte e non ancora prese in carico*'" >> script.py
echo " }" >> script.py
echo " }," >> script.py
echo " {" >> script.py
echo " 'type': 'divider'" >> script.py
echo " }" >> script.py
echo " ]" >> script.py
echo " }" >> script.py
echo "" >> script.py
echo " for issue in issues:" >> script.py
echo " issue_text = f'<{issue['html_url']}|{issue['title']}>'" >> script.py
echo " issue_url = issue['html_url']" >> script.py
echo " issue_title = issue['title']" >> script.py
echo " issue_created_at = issue['created_at']" >> script.py
echo " issue_creator = issue['user']['login']" >> script.py
echo " message['blocks'].append({" >> script.py
echo " 'type': 'section'," >> script.py
echo " 'text': {" >> script.py
echo " 'type': 'mrkdwn'," >> script.py
echo " 'text': issue_text" >> script.py
echo " }" >> script.py
echo " 'fields': [" >> script.py
echo " {" >> script.py
echo " 'type': 'mrkdwn'," >> script.py
echo " 'text': f'*< {issue_url} | {issue_title} >*'" >> script.py
echo " }," >> script.py
echo " {" >> script.py
echo " 'type': 'mrkdwn'," >> script.py
echo " 'text': f'*Creato il:* {issue_created_at}'" >> script.py
echo " }," >> script.py
echo " {" >> script.py
echo " 'type': 'mrkdwn'," >> script.py
echo " 'text': f'*Creato da:* {issue_creator}'" >> script.py
echo " }" >> script.py
echo " ]" >> script.py
echo " })" >> script.py
echo " message['blocks'].append({" >> script.py
echo " 'type': 'divider'" >> script.py
echo " })" >> script.py
echo " return message" >> script.py
echo "" >> script.py
Expand Down

0 comments on commit 35e8410

Please sign in to comment.