Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 30 additions & 6 deletions .github/data/contributors-log.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,12 @@
},
"Animal-Guess": {
"contributor-name": [
"ShashiNova"
"ShashiNova",
"Achi-Vyshnavi"
],
"pull-request-number": [
"8"
"8",
"56"
],
"demo-path": "https://github.com/Grow-with-Open-Source/Python-Projects/tree/main/Animal-Guess"
},
Expand Down Expand Up @@ -121,11 +123,13 @@
"Number-Guess": {
"contributor-name": [
"adedayoprcs",
"sheylaghost"
"sheylaghost",
"Achi-Vyshnavi"
],
"pull-request-number": [
"19",
"43"
"43",
"57"
],
"demo-path": "Number-Guess"
},
Expand Down Expand Up @@ -167,10 +171,12 @@
},
"Coin-Poison": {
"contributor-name": [
"niharikah005"
"niharikah005",
"Achi-Vyshnavi"
],
"pull-request-number": [
"24"
"24",
"55"
],
"demo-path": "Coin-Poison"
},
Expand Down Expand Up @@ -266,5 +272,23 @@
"49"
],
"demo-path": "Binary-Gene-Classifier-Model"
},
"Auto-Clicker": {
"contributor-name": [
"BasselDar"
],
"pull-request-number": [
"54"
],
"demo-path": "Auto-Clicker"
},
"Number-Plate-Detection": {
"contributor-name": [
"iamdevdhanush"
],
"pull-request-number": [
"58"
],
"demo-path": "Number-Plate-Detection"
}
}
2 changes: 1 addition & 1 deletion .github/scripts/convert_to_html_tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def main():
# Processing pull-requests
pull_requests = details['pull-request-number']
pull_requests_list = [
f'<a href="https://github.com/{REPO_NAME}/pull/{pr}" title="visit pr \#{pr}">{pr}</a>' for pr in pull_requests]
f'<a href="https://github.com/{REPO_NAME}/pull/{pr}" title="visit pr #{pr}">{pr}</a>' for pr in pull_requests]
pull_requests_output = ', '.join(pull_requests_list)

# Processing demo-path
Expand Down
2 changes: 1 addition & 1 deletion .github/scripts/update_index_md.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def main():
# Processing pull-requests
pull_requests = details['pull-request-number']
pull_requests_list = [
f'[#{pr}](https://github.com/{REPO_NAME}/pull/{pr} "visit pr \#{pr}")' for pr in pull_requests]
f'[#{pr}](https://github.com/{REPO_NAME}/pull/{pr} "visit pr #{pr}")' for pr in pull_requests]
pull_requests_output = ', '.join(pull_requests_list)

# Processing demo-path
Expand Down
36 changes: 27 additions & 9 deletions .github/workflows/update-contributors-details.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,39 @@ on:
types: [closed]
branches: [main]

env:
REPO_NAME: ${{ github.repository }}
PR_NUMBER: ${{ github.event.pull_request.number }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
update-by-pr:
if: ${{ github.event.pull_request.title != 'init' && github.event.pull_request.merged == true }}
if: |
github.event.pull_request.merged == true &&
!contains(github.event.pull_request.title, 'maintenance') &&
!contains(github.event.pull_request.title, 'Maintenance')

runs-on: ubuntu-latest

permissions:
contents: write

env:
REPO_NAME: ${{ github.repository }}
PR_NUMBER: ${{ github.event.pull_request.number }}

steps:
- name: Checking out the repo
uses: actions/[email protected]

- name: Setup Python
uses: actions/[email protected]
with:
python-version: 3.12

- name: Getting PR details
run: |
touch pr.json
gh pr view $PR_NUMBER --json author,url,files > pr.json
cat pr.json

- name: Pull any new changes
run: git pull origin main

- name: Updating log file
run: |
Expand All @@ -37,27 +46,36 @@ jobs:
echo "Create `.github/data` directory"
fi
python .github/scripts/update_contributors_log.py
cat .github/data/contributors-log.json
git diff .github/data/contributors-log.json

- name: Updating index.md file
run: |
python .github/scripts/update_index_md.py
cat index.md
git diff index.md

- name: Remove unwanted files
run: rm pr.json

- name: Commit and Push
run: |
if [ "$(git status | grep 'Changes not staged\|Untracked files')" ]; then
echo "::group::Printing All Diffs"
git diff
echo "::endgroup::"

echo "::group::Configuring GitHub Action as author"
git config --global user.email "[email protected]"
git config --global user.name "GitHub Actions"
git config --list | cat
echo "::endgroup::"

echo "::group::Adding and Pushing Changes"
git add .
git commit -m "Updated Contributors Details"
git push origin main
echo "Pushed the update successfully"
echo "::endgroup::"
else
echo "Nothing to push"
echo "::error::No Changes detected!"
exit 1
fi
Loading