-
-
Notifications
You must be signed in to change notification settings - Fork 103
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
Changes from 3 commits
6a7ef29
9c6f337
d5be656
525bdfe
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- "*" | ||
|
||
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
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
|
||
steps: | ||
- name: Contribute List | ||
uses: akhilmhdh/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
Comment on lines
+14
to
+18
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 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
|
There was a problem hiding this comment.
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 targetingmain
:This change would reduce unnecessary workflow runs while still updating the contributors list when changes are merged into the main branch.