Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Submissions page #57

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
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
39 changes: 39 additions & 0 deletions .github/workflows/submissions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Process and Update Submissions

on:
push:
branches:
- master

jobs:
process:
runs-on: ubuntu-latest

permissions:
contents: write

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: List directory contents
run: |
ls -R

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt

- name: Run submission processing script
run: |
python docs/submissions.py

- name: Commit changes
run: |
git add docs/submissions.md
git commit -m "Update submissions.md with processed links" || echo "No changes to commit"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,13 @@ Thank you to everyone who decides to participate. Community challenges like this
<sub><b>Amudha Balamurugan</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/Sushant1209">
<img src="https://avatars.githubusercontent.com/u/92586894?v=4" width="100;" alt="Sushant1209"/>
<br />
<sub><b>Sushant Bagul</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/SuryenduB">
<img src="https://avatars.githubusercontent.com/u/53970796?v=4" width="100;" alt="SuryenduB"/>
Expand All @@ -93,15 +100,15 @@ Thank you to everyone who decides to participate. Community challenges like this
<sub><b>Meriem Terki</b></sub>
</a>
</td>
</tr>
<tr>
<td align="center">
<a href="https://github.com/JQCVSC">
<img src="https://avatars.githubusercontent.com/u/65506340?v=4" width="100;" alt="JQCVSC"/>
<br />
<sub><b>JQCVSC</b></sub>
</a>
</td>
</tr>
<tr>
<td align="center">
<a href="https://github.com/heinhtetwin">
<img src="https://avatars.githubusercontent.com/u/48096774?v=4" width="100;" alt="heinhtetwin"/>
Expand Down Expand Up @@ -137,15 +144,15 @@ Thank you to everyone who decides to participate. Community challenges like this
<sub><b>Zablon</b></sub>
</a>
</td>
</tr>
<tr>
<td align="center">
<a href="https://github.com/TomiwaAribisala-git">
<img src="https://avatars.githubusercontent.com/u/109365443?v=4" width="100;" alt="TomiwaAribisala-git"/>
<br />
<sub><b>Tomiwa </b></sub>
</a>
</td>
</tr>
<tr>
<td align="center">
<a href="https://github.com/rohit1101">
<img src="https://avatars.githubusercontent.com/u/37110560?v=4" width="100;" alt="rohit1101"/>
Expand Down Expand Up @@ -181,21 +188,14 @@ Thank you to everyone who decides to participate. Community challenges like this
<sub><b>Jaivir Baweja</b></sub>
</a>
</td>
</tr>
<tr>
<td align="center">
<a href="https://github.com/vikramnayyarcs">
<img src="https://avatars.githubusercontent.com/u/66060875?v=4" width="100;" alt="vikramnayyarcs"/>
<br />
<sub><b>Vikram</b></sub>
</a>
</td>
</tr>
<tr>
<td align="center">
<a href="https://github.com/Sushant1209">
<img src="https://avatars.githubusercontent.com/u/92586894?v=4" width="100;" alt="Sushant1209"/>
<br />
<sub><b>Sushant Bagul</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/meghanasaivattikuti">
Expand Down
2 changes: 1 addition & 1 deletion docs/submissions.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ This is the place to add your own Cloud Resume API project!
| Name | Resume API URL | GitHub Repo |
|---------------|--------------------------------------------------------------------------------------------------------------------------| ----------- |
| CityHallin | https://api.cityhallin.com/v1/resume?name=cityhallin | https://github.com/CityHallin/cloud_resume_api_challenge |
| Sushant Bagul | https://sushantresumeapi.azurewebsites.net/resumeapi?id=1 | https://github.com/Sushant1209/Azure-Resume-API-Challenge |
| Sushant Bagul | https://sushantbagul.azurewebsites.net/resumeapi?id=1 | https://github.com/Sushant1209/Azure-Resume-API-Challenge |
| Charles Nwoye | [https://jkcloudresumeapi.azurewebsites.net/api/resume?id=1](https://jkcloudresumeapi.azurewebsites.net/api/resume?id=1) | [https://github.com/Jekwulum/cloud-resume-api.git](https://github.com/Jekwulum/cloud-resume-api.git) |
| Hamit Sehjal | https://resume26hamitfunc.azurewebsites.net/hamitsehjal | https://github.com/hamitsehjal/Serverless-Cloud-Resume |

Expand Down
54 changes: 54 additions & 0 deletions docs/submissions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# The script code, adjusted to write directly to 'submissions.md'

import re

def convert_table_links():
input_file = 'docs/submissions.md'
output_file = 'docs/submissions.md'

with open(input_file, 'r') as f:
content = f.read()

# Regular expressions to match table rows
separator_pattern = re.compile(r'^\|[-| ]+\|[-| ]+\|[-| ]+\|$')
row_pattern = re.compile(r'^\|([^|\n]+?)\|([^|\n]+?)\|([^|\n]+?)\|$')

# Flag to start processing inside a table
in_table = False
output_lines = []

def debug_log(line, status):
print(f"Processing line: {line} | Status: {status}")

# Process content
for line in content.splitlines():
if separator_pattern.match(line):
in_table = True
debug_log(line, "Table separator detected")
elif row_pattern.match(line):
if in_table:
match = row_pattern.match(line)
if match:
name, url1, url2 = [s.strip() for s in match.groups()]
url1 = f'[{url1}]({url1})' if url1 and not url1.startswith('[') else url1
url2 = f'[{url2}]({url2})' if url2 and not url2.startswith('[') else url2
line = f'| {name} | {url1} | {url2} |'
debug_log(line, "Row processed")
else:
debug_log(line, "Row not matched")
else:
debug_log(line, "Row found outside of table")
else:
if in_table:
in_table = False
debug_log(line, "End of table detected")

output_lines.append(line)

new_content = '\n'.join(output_lines)

with open(output_file, 'w') as f:
f.write(new_content)

# Run the function
convert_table_links()