202312 message GitHub discussions #11
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
name: Post GitHub Discussions Statistics | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 7 * * 1' # Every Monday at 7:00 AM UTC (9:00 AM CET) | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
- labeled | |
- unlabeled | |
jobs: | |
run: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.10' # Use the desired Python version | |
- name: Install dependencies | |
run: | | |
pip install python-graphql-client | |
pip install python-dateutil | |
working-directory: ${{ github.workspace }} | |
- name: Run script get-weekly-discussions-stats.py | |
id: create_message | |
run: | | |
echo "::set-output name=output_var::$(python scripts/get-weekly-discussions-stats.py)" | |
working-directory: ${{ github.workspace }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Send message to SOFA channel using Cake | |
uses: cake-build/cake-action@v1 | |
with: | |
script-path: scripts/send-gitter-message.cake | |
env: | |
Gitter_token: "syt_c29mYWJvdC01YTg0MDU0OGQ3MzQwOGNlNGY4ZDE1Njk_SjdArMIDLUbnoqPigtAS_2QBfb0" | |
Gitter_message: ${{ steps.create_message.outputs.output_var }} | |
# - name: Send message to SOFA channel | |
# uses: fadenb/[email protected] | |
# with: | |
# homeserver: 'https://gitter.ems.host/' | |
# token: ${{ secrets.MATRIX_TOKEN }} | |
# channel: '!XWVzIQpwOMjHkyTsNE:gitter.im' | |
# message: ${{ steps.create_message.outputs.output_var }} | |