Skip to content

Commit 24c9977

Browse files
authored
PR #59: Maintenance-Hot Fix
Maintenance: Hot Fix for recent failed GitHub Actions Merge pull request #59 from Grow-with-Open-Source/hot-fix-1
2 parents cde145c + 7c89542 commit 24c9977

File tree

5 files changed

+90
-46
lines changed

5 files changed

+90
-46
lines changed

.github/data/contributors-log.json

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,12 @@
3737
},
3838
"Animal-Guess": {
3939
"contributor-name": [
40-
"ShashiNova"
40+
"ShashiNova",
41+
"Achi-Vyshnavi"
4142
],
4243
"pull-request-number": [
43-
"8"
44+
"8",
45+
"56"
4446
],
4547
"demo-path": "https://github.com/Grow-with-Open-Source/Python-Projects/tree/main/Animal-Guess"
4648
},
@@ -121,11 +123,13 @@
121123
"Number-Guess": {
122124
"contributor-name": [
123125
"adedayoprcs",
124-
"sheylaghost"
126+
"sheylaghost",
127+
"Achi-Vyshnavi"
125128
],
126129
"pull-request-number": [
127130
"19",
128-
"43"
131+
"43",
132+
"57"
129133
],
130134
"demo-path": "Number-Guess"
131135
},
@@ -167,10 +171,12 @@
167171
},
168172
"Coin-Poison": {
169173
"contributor-name": [
170-
"niharikah005"
174+
"niharikah005",
175+
"Achi-Vyshnavi"
171176
],
172177
"pull-request-number": [
173-
"24"
178+
"24",
179+
"55"
174180
],
175181
"demo-path": "Coin-Poison"
176182
},
@@ -266,5 +272,23 @@
266272
"49"
267273
],
268274
"demo-path": "Binary-Gene-Classifier-Model"
275+
},
276+
"Auto-Clicker": {
277+
"contributor-name": [
278+
"BasselDar"
279+
],
280+
"pull-request-number": [
281+
"54"
282+
],
283+
"demo-path": "Auto-Clicker"
284+
},
285+
"Number-Plate-Detection": {
286+
"contributor-name": [
287+
"iamdevdhanush"
288+
],
289+
"pull-request-number": [
290+
"58"
291+
],
292+
"demo-path": "Number-Plate-Detection"
269293
}
270294
}

.github/scripts/convert_to_html_tables.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def main():
117117
# Processing pull-requests
118118
pull_requests = details['pull-request-number']
119119
pull_requests_list = [
120-
f'<a href="https://github.com/{REPO_NAME}/pull/{pr}" title="visit pr \#{pr}">{pr}</a>' for pr in pull_requests]
120+
f'<a href="https://github.com/{REPO_NAME}/pull/{pr}" title="visit pr #{pr}">{pr}</a>' for pr in pull_requests]
121121
pull_requests_output = ', '.join(pull_requests_list)
122122

123123
# Processing demo-path

.github/scripts/update_index_md.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def main():
115115
# Processing pull-requests
116116
pull_requests = details['pull-request-number']
117117
pull_requests_list = [
118-
f'[#{pr}](https://github.com/{REPO_NAME}/pull/{pr} "visit pr \#{pr}")' for pr in pull_requests]
118+
f'[#{pr}](https://github.com/{REPO_NAME}/pull/{pr} "visit pr #{pr}")' for pr in pull_requests]
119119
pull_requests_output = ', '.join(pull_requests_list)
120120

121121
# Processing demo-path

.github/workflows/update-contributors-details.yml

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,39 @@ on:
55
types: [closed]
66
branches: [main]
77

8-
env:
9-
REPO_NAME: ${{ github.repository }}
10-
PR_NUMBER: ${{ github.event.pull_request.number }}
11-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
12-
138
jobs:
149
update-by-pr:
15-
if: ${{ github.event.pull_request.title != 'init' && github.event.pull_request.merged == true }}
10+
if: |
11+
github.event.pull_request.merged == true &&
12+
!contains(github.event.pull_request.title, 'maintenance') &&
13+
!contains(github.event.pull_request.title, 'Maintenance')
14+
1615
runs-on: ubuntu-latest
1716

1817
permissions:
1918
contents: write
2019

20+
env:
21+
REPO_NAME: ${{ github.repository }}
22+
PR_NUMBER: ${{ github.event.pull_request.number }}
23+
2124
steps:
2225
- name: Checking out the repo
2326
uses: actions/[email protected]
2427

2528
- name: Setup Python
2629
uses: actions/[email protected]
30+
with:
31+
python-version: 3.12
2732

2833
- name: Getting PR details
2934
run: |
3035
touch pr.json
3136
gh pr view $PR_NUMBER --json author,url,files > pr.json
37+
cat pr.json
38+
39+
- name: Pull any new changes
40+
run: git pull origin main
3241

3342
- name: Updating log file
3443
run: |
@@ -37,27 +46,36 @@ jobs:
3746
echo "Create `.github/data` directory"
3847
fi
3948
python .github/scripts/update_contributors_log.py
40-
cat .github/data/contributors-log.json
49+
git diff .github/data/contributors-log.json
4150
4251
- name: Updating index.md file
4352
run: |
4453
python .github/scripts/update_index_md.py
45-
cat index.md
54+
git diff index.md
4655
4756
- name: Remove unwanted files
4857
run: rm pr.json
4958

5059
- name: Commit and Push
5160
run: |
5261
if [ "$(git status | grep 'Changes not staged\|Untracked files')" ]; then
62+
echo "::group::Printing All Diffs"
5363
git diff
64+
echo "::endgroup::"
65+
66+
echo "::group::Configuring GitHub Action as author"
5467
git config --global user.email "[email protected]"
5568
git config --global user.name "GitHub Actions"
69+
git config --list | cat
70+
echo "::endgroup::"
71+
72+
echo "::group::Adding and Pushing Changes"
5673
git add .
5774
git commit -m "Updated Contributors Details"
5875
git push origin main
5976
echo "Pushed the update successfully"
77+
echo "::endgroup::"
6078
else
61-
echo "Nothing to push"
79+
echo "::error::No Changes detected!"
6280
exit 1
6381
fi

0 commit comments

Comments
 (0)