Skip to content

Commit

Permalink
Update internal-contributor-of-the-month.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
Vadym Sachenko committed Jul 19, 2023
1 parent a15014e commit 6100cec
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/internal-contributor-of-the-month.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: External Contributor of the Month
name: Internal Contributor of the Month

on:
push:
branches:
- internal-contributor-workflow'
- 'contributor-workflow'

jobs:
determine-internal-contributor:
Expand All @@ -16,8 +16,8 @@ jobs:
id: determine
run: |
# Set the start and end dates for June 2023
START_DATE="2023-05-01"
END_DATE="2023-05-31"
START_DATE="2023-06-01"
END_DATE="2023-06-30"
MONTH_NAME="June"
# Exclude certain users
Expand All @@ -31,8 +31,8 @@ jobs:
# Fetch merged pull requests within the specified date range
PRS=$(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
"https://api.github.com/repos/spryker/spryker-docs/pulls?state=closed&sort=created&direction=desc&merge_state=merged&page=$PAGE&per_page=100" \
| jq -r --arg START "$START_DATE" --arg END "$END_DATE" 'map(select(.merged_at >= $START and .merged_at <= $END and (.labels[].name | test("Contributor")))) | .[].user.login')
"https://api.github.com/repos/spryker/spryker-docs/pulls?state=closed&base=master&sort=created&direction=desc&merge_state=merged&page=$PAGE&per_page=100" \
| jq -r --arg START "$START_DATE" --arg END "$END_DATE" 'map(select(.merged_at >= $START and .merged_at <= $END)) | .[].user.login')
if [ -z "$PRS" ]; then
break
Expand Down Expand Up @@ -62,7 +62,7 @@ jobs:
done
TOP_CONTRIBUTORS_LIST=$(IFS=,; echo "${TOP_CONTRIBUTORS[*]}")
TOP_CONTRIBUTORS_TEXT="The top external contributor(s) of $MONTH_NAME: $TOP_CONTRIBUTORS_LIST (PRs: $MAX_COUNT)"
TOP_CONTRIBUTORS_TEXT="The top contributor(s) of $MONTH_NAME: $TOP_CONTRIBUTORS_LIST (PRs: $MAX_COUNT)"
echo "TOP_CONTRIBUTORS_TEXT=$TOP_CONTRIBUTORS_TEXT" >> $GITHUB_ENV
Expand All @@ -82,9 +82,9 @@ jobs:
MONTH_NAME="${{ env.MONTH_NAME }}"
TOP_CONTRIBUTORS_TEXT="${{ env.TOP_CONTRIBUTORS_TEXT }}"
# Print all external contributors of the month and the number of PRs they created
echo "External Contributors of $MONTH_NAME:"
# Print all contributors of the month and the number of PRs they created
echo "Contributors of $MONTH_NAME:"
echo -e "$CONTRIBUTORS"
# Print the top external contributor(s) of the month
# Print the top contributor(s) of the month
echo "$TOP_CONTRIBUTORS_TEXT"

0 comments on commit 6100cec

Please sign in to comment.