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

fixed the contributors readme issue. #77

Merged
merged 4 commits into from
Oct 5, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
18 changes: 18 additions & 0 deletions .github/workflows/contributors.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
on:
push:
branches:
- main
- "*"
Comment on lines +1 to +5
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Consider refining the workflow trigger.

The current trigger configuration runs the workflow on every push to any branch, which might be unnecessary for branches other than main.

Consider limiting the workflow to run only on pushes to the main branch and pull requests targeting main:

on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - main

This change would reduce unnecessary workflow runs while still updating the contributors list when changes are merged into the main branch.


jobs:
contrib-readme-job:
runs-on: ubuntu-latest
name: A job to automate contrib in readme
permissions:
contents: write
pull-requests: write
Comment on lines +7 to +13
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Job configuration looks good, but consider adding a concurrency group.

The job configuration and permissions are correctly set up. However, to prevent concurrent runs of this workflow, which could lead to conflicts when updating the README, consider adding a concurrency group.

Add a concurrency configuration to the workflow:

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

jobs:
  contrib-readme-job:
    # ... (rest of the job configuration)

This addition will ensure that only one instance of this workflow runs at a time for each branch, canceling any in-progress runs if a new commit is pushed.

🧰 Tools
🪛 yamllint

[warning] 12-12: wrong indentation: expected 12 but found 10

(indentation)

steps:
- name: Contribute List
uses: akhilmhdh/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Comment on lines +14 to +18
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Action configuration is correct, but consider adding error handling.

The step using the contributors-readme-action is correctly configured. However, it's a good practice to add error handling and provide more information about the step's purpose.

Enhance the step configuration:

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

  - name: Update Contributors List in README
    uses: akhilmhdh/[email protected]
    env:
      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    continue-on-error: true

  - name: Check for changes
    id: git-check
    run: |
      git diff --exit-code || echo "changes=true" >> $GITHUB_OUTPUT

  - name: Commit changes
    if: steps.git-check.outputs.changes == 'true'
    run: |
      git config --local user.email "[email protected]"
      git config --local user.name "GitHub Action"
      git add README.md
      git commit -m "docs: update contributors list"
      git push

These changes add error handling, explicitly checkout the repository, and only commit changes if the README was actually modified.

🧰 Tools
🪛 yamllint

[error] 18-18: no new line character at the end of file

(new-line-at-end-of-file)

83 changes: 81 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,87 @@ Special thanks to our amazing mentors who are guiding this project! 🙌
<br>
<center>
<div>

[![All Contributors](https://img.shields.io/github/all-contributors/RamakrushnaBiswal/PlayCafe?color=ee8449&style=flat-square)](#contributors)
<!-- readme: contributors -start -->
<table>
<tbody>
<tr>
<td align="center">
<a href="https://github.com/RamakrushnaBiswal">
<img src="https://avatars.githubusercontent.com/u/125277258?v=4" width="100;" alt="RamakrushnaBiswal"/>
<br />
<sub><b>Ramakrushna Biswal</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/samar12-rad">
<img src="https://avatars.githubusercontent.com/u/128586929?v=4" width="100;" alt="samar12-rad"/>
<br />
<sub><b>Samarth Vaidya</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/tejasbenibagde">
<img src="https://avatars.githubusercontent.com/u/124677750?v=4" width="100;" alt="tejasbenibagde"/>
<br />
<sub><b>Tejas Benibagde</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/Suhas-Koheda">
<img src="https://avatars.githubusercontent.com/u/72063139?v=4" width="100;" alt="Suhas-Koheda"/>
<br />
<sub><b>Suhas Koheda</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/sajalbatra">
<img src="https://avatars.githubusercontent.com/u/125984550?v=4" width="100;" alt="sajalbatra"/>
<br />
<sub><b>Sajal Batra</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/itznayan">
<img src="https://avatars.githubusercontent.com/u/136584376?v=4" width="100;" alt="itznayan"/>
<br />
<sub><b>Mahera Nayan</b></sub>
</a>
</td>
</tr>
<tr>
<td align="center">
<a href="https://github.com/mishradev1">
<img src="https://avatars.githubusercontent.com/u/118660840?v=4" width="100;" alt="mishradev1"/>
<br />
<sub><b>Dev Mishra</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/Syed-Farazuddin">
<img src="https://avatars.githubusercontent.com/u/119295880?v=4" width="100;" alt="Syed-Farazuddin"/>
<br />
<sub><b>Syed Faraz</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/Vaibhav-Kumar-K-R">
<img src="https://avatars.githubusercontent.com/u/132189791?v=4" width="100;" alt="Vaibhav-Kumar-K-R"/>
<br />
<sub><b>Vaibhav-Kumar-K-R</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/vishnuprasad2004">
<img src="https://avatars.githubusercontent.com/u/116942066?v=4" width="100;" alt="vishnuprasad2004"/>
<br />
<sub><b>Vishnu Prasad Korada</b></sub>
</a>
</td>
</tr>
<tbody>
</table>
<!-- readme: contributors -end -->



## ⭐Support
Expand Down
Loading