Post MaCh3 Newsletter #26
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 MaCh3 Newsletter | |
on: | |
schedule: | |
- cron: '0 0 * * 1' # Every Monday at midnight | |
jobs: | |
post_discussion: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout the MaCh3 repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Fetch all history including tags | |
repository: mach3-software/MaCh3 | |
- name: Count the total number of commits in MaCh3 | |
run: | | |
echo "commit_count=$(git rev-list --count HEAD)" >> "$GITHUB_ENV" | |
- name: Count commits in the last week for MaCh3 | |
run: | | |
echo "commits_last_week=$(git rev-list --count --since='1 week ago' HEAD)" >> "$GITHUB_ENV" | |
- name: Get the most recent tag for MaCh3 | |
run: | | |
latest_tag=$(git describe --tags --abbrev=0) | |
echo "latest_tag=${latest_tag}" >> "$GITHUB_ENV" | |
- name: Get the current date | |
run: | | |
current_date=$(date +"%d/%m/%Y") | |
echo "current_date=${current_date}" >> $GITHUB_ENV | |
- name: Get the most active author in the last week for MaCh3 | |
run: | | |
most_active_author=$(git log --since='1 week ago' --pretty=format:"%an" | sort | uniq -c | sort -nr | head -n 1) | |
echo "most_active_author=${most_active_author}" >> "$GITHUB_ENV" | |
- name: Get the author with most commits (count and name) | |
run: | | |
COUNT=$(echo "$most_active_author" | awk '{print $1}') | |
NAME=$(echo "$most_active_author" | awk '{$1=""; sub(/^ /, ""); print}') | |
echo "maCh3_most_active_author_count=${COUNT}" >> "$GITHUB_ENV" | |
echo "maCh3_most_active_author_name=${NAME}" >> "$GITHUB_ENV" | |
- name: Checkout the MaCh3Tutorial repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Fetch all history including tags | |
repository: mach3-software/MaCh3Tutorial | |
path: MaCh3Tutorial | |
- name: Count the total number of commits in MaCh3Tutorial | |
run: | | |
echo "tutorial_commit_count=$(git -C MaCh3Tutorial rev-list --count HEAD)" >> "$GITHUB_ENV" | |
- name: Count commits in the last week for MaCh3Tutorial | |
run: | | |
echo "tutorial_commits_last_week=$(git -C MaCh3Tutorial rev-list --count --since='1 week ago' HEAD)" >> "$GITHUB_ENV" | |
- name: Get the most recent tag for MaCh3Tutorial | |
run: | | |
tutorial_latest_tag=$(git -C MaCh3Tutorial describe --tags --abbrev=0) | |
echo "tutorial_latest_tag=${tutorial_latest_tag}" >> "$GITHUB_ENV" | |
- name: Get the most active author in the last week for MaCh3Tutorial | |
run: | | |
most_active_author=$(git -C MaCh3Tutorial log --since='1 week ago' --pretty=format:"%an" | sort | uniq -c | sort -nr | head -n 1) | |
echo "tutorial_most_active_author=${most_active_author}" >> "$GITHUB_ENV" | |
- name: Get the author with most commits for MaCh3Tutorial (count and name) | |
run: | | |
COUNT=$(echo "$tutorial_most_active_author" | awk '{print $1}') | |
NAME=$(echo "$tutorial_most_active_author" | awk '{$1=""; sub(/^ /, ""); print}') | |
echo "maCh3Tutorial_most_active_author_count=${COUNT}" >> "$GITHUB_ENV" | |
echo "maCh3Tutorial_most_active_author_name=${NAME}" >> "$GITHUB_ENV" | |
- name: Checkout the MaCh3-PythonUtils repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Fetch all history including tags | |
repository: mach3-software/MaCh3-PythonUtils | |
path: MaCh3-PythonUtils | |
- name: Count the total number of commits in MaCh3-PythonUtils | |
run: | | |
echo "python_utils_commit_count=$(git -C MaCh3-PythonUtils rev-list --count HEAD)" >> "$GITHUB_ENV" | |
- name: Count commits in the last week for MaCh3-PythonUtils | |
run: | | |
echo "python_utils_commits_last_week=$(git -C MaCh3-PythonUtils rev-list --count --since='1 week ago' HEAD)" >> "$GITHUB_ENV" | |
- name: Get the most recent tag for MaCh3-PythonUtils | |
run: | | |
python_utils_latest_tag=$(git -C MaCh3-PythonUtils describe --tags --abbrev=0) | |
echo "python_utils_latest_tag=${python_utils_latest_tag}" >> "$GITHUB_ENV" | |
- name: Get the most active author in the last week for MaCh3-PythonUtils | |
run: | | |
most_active_author=$(git -C MaCh3-PythonUtils log --since='1 week ago' --pretty=format:"%an" | sort | uniq -c | sort -nr | head -n 1) | |
echo "python_utils_most_active_author=${most_active_author}" >> "$GITHUB_ENV" | |
- name: Get the author with most commits for MaCh3-PythonUtils (count and name) | |
run: | | |
COUNT=$(echo "$python_utils_most_active_author" | awk '{print $1}') | |
NAME=$(echo "$python_utils_most_active_author" | awk '{$1=""; sub(/^ /, ""); print}') | |
echo "maCh3PythonUtils_most_active_author_count=${COUNT}" >> "$GITHUB_ENV" | |
echo "maCh3PythonUtils_most_active_author_name=${NAME}" >> "$GITHUB_ENV" | |
- name: Create a new GitHub Discussion | |
uses: abirismyname/[email protected] | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
title: MaCh3 Newsletter - ${{ env.current_date }} | |
body: | | |
It's-a me, MaChio! Welcome to the newsletter. | |
Date: ${{ env.current_date }} | |
**MaCh3 Repository** | |
- Total number of commits: ${{ env.commit_count }} | |
- Total number of commits in the last week: ${{ env.commits_last_week }} | |
- Most recent tag: ${{ env.latest_tag }} | |
- Most active author in the last week: ${{ env.maCh3_most_active_author_name }} (Commits: ${{ env.maCh3_most_active_author_count }}) | |
**MaCh3Tutorial Repository** | |
- Total number of commits: ${{ env.tutorial_commit_count }} | |
- Total number of commits in the last week: ${{ env.tutorial_commits_last_week }} | |
- Most recent tag: ${{ env.tutorial_latest_tag }} | |
- Most active author in the last week: ${{ env.maCh3Tutorial_most_active_author_name }} (Commits: ${{ env.maCh3Tutorial_most_active_author_count }}) | |
**MaCh3-PythonUtils Repository** | |
- Total number of commits: ${{ env.python_utils_commit_count }} | |
- Total number of commits in the last week: ${{ env.python_utils_commits_last_week }} | |
- Most recent tag: ${{ env.python_utils_latest_tag }} | |
- Most active author in the last week: ${{ env.maCh3PythonUtils_most_active_author_name }} (Commits: ${{ env.maCh3PythonUtils_most_active_author_count }}) | |
Cheers, | |
MaCh3-bot | |
repository-id: MDEwOlJlcG9zaXRvcnkzMzEwNDk0MTY= | |
category-id: DIC_kwDOE7tpyM4CgQ7H |