-
Notifications
You must be signed in to change notification settings - Fork 1
First one for demo #5
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
base: main
Are you sure you want to change the base?
Changes from all commits
c76e94e
9af595a
4b83e9b
3d9b4ca
6b97fc1
6fb2dc7
662bf93
052577e
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 |
|---|---|---|
|
|
@@ -13,32 +13,10 @@ jobs: | |
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v3 | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v2 | ||
|
|
||
| - name: Cache Docker layers | ||
| uses: actions/cache@v3 | ||
| with: | ||
| path: /tmp/.buildx-cache | ||
| key: ${{ runner.os }}-docker-${{ github.sha }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-docker- | ||
|
|
||
|
|
||
| - name: Pull Docker image | ||
| run: | | ||
| docker buildx create --use | ||
| docker pull arshikjaved/pr-review:v1.0 || true | ||
| docker buildx build --cache-from=type=local,src=/tmp/.buildx-cache \ | ||
| --cache-to=type=local,dest=/tmp/.buildx-cache-new \ | ||
| -t arshikjaved/pr-review:v1.0 . | ||
|
|
||
| - name: Update Docker cache | ||
| if: success() | ||
| run: | | ||
| rm -rf /tmp/.buildx-cache | ||
| mv /tmp/.buildx-cache-new /tmp/.buildx-cache | ||
|
|
||
| run: docker pull arshikjaved/pr-review:v1.0 | ||
|
|
||
| - name: Set script name | ||
| id: script_name | ||
| run: | | ||
|
|
@@ -59,7 +37,7 @@ jobs: | |
| LINE_NUMBER: ${{ github.event.comment.line }} | ||
| REPOSITORY_OWNER: ${{ github.repository_owner }} | ||
| REPOSITORY_NAME: ${{ github.event.repository.name }} | ||
| SCRIPT: ${{ steps.script_name.outputs.script }} | ||
| SCRIPT: ${{ github.event_name == 'pull_request' && 'generate_response.py' || 'reply_thread.py' }} | ||
| COMMIT_SHA: ${{ github.event.pull_request.head.sha }} | ||
| PR_NUMBER: ${{ github.event.pull_request.number }} | ||
|
|
||
|
|
@@ -68,4 +46,6 @@ jobs: | |
| docker run --rm -e OWNER='${{env.REPOSITORY_OWNER}}' -e REPO_NAME='${{env.REPOSITORY_NAME}}' -e COMMIT_SHA="${{ github.event.pull_request.head.sha }}" -e PR_NUMBER="${{ github.event.pull_request.number }}" -e ACTION="${{env.ACTION}}" -e EVENT_NAME="${{ env.EVENT_NAME }}" arshikjaved/pr-review:v1.0 sh -c "python /app/generate_response.py --owner '${{env.REPOSITORY_OWNER}}' --repo-name '${{env.REPOSITORY_NAME}}' --commit-sha '${{ env.COMMIT_SHA }}' --pr-number '${{ env.PR_NUMBER }}' --event-name '${{ env.EVENT_NAME }}' --action '${{ env.ACTION }}'" | ||
| else | ||
| docker run --rm -e OWNER='${{env.REPOSITORY_OWNER}}' -e REPO_NAME='${{env.REPOSITORY_NAME}}' -e COMMIT_SHA="${{ github.event.pull_request.head.sha }}" -e PR_NUMBER="${{ github.event.pull_request.number }}" -e EVENT_NAME="${{ env.EVENT_NAME }}" arshikjaved/pr-review:v1.0 sh -c "python /app/reply_thread.py --owner '${{env.REPOSITORY_OWNER}}' --repo-name '${{env.REPOSITORY_NAME}}' --commit-sha '${{ env.COMMIT_SHA }}' --pr-number '${{ env.PR_NUMBER }}' --event-name '${{ env.EVENT_NAME }}' --comment-body '${{ env.COMMENT_BODY }}' --comment-id '${{ env.COMMENT_ID }}' --file-path '${{ env.FILE_PATH }}' --line-number '${{ env.LINE_NUMBER }}'" | ||
|
Collaborator
Author
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. The docker run command is not checking if the script exists before running it. It's possible that the script might not exist in the container, which would cause the command to fail. Consider adding a check to ensure the script exists before running it. |
||
| fi | ||
| fi | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -37,7 +37,7 @@ exports.update = (req, res) => { | |
| category.save((err, data) => { | ||
| if (err) { | ||
| return res.status(400).json({ | ||
| error: errorHandler(err), | ||
| error: errorHandlerr(err), | ||
|
Collaborator
Author
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. Typo in |
||
| }); | ||
| } | ||
| res.json(data); | ||
|
|
@@ -59,7 +59,7 @@ exports.remove = (req, res) => { | |
| }; | ||
|
|
||
| exports.list = (req, res) => { | ||
| Category.find().exec((err, data) => { | ||
| Categoryy.find().exec((err, data) => { | ||
|
Collaborator
Author
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. Typo in |
||
| if (err) { | ||
| return res.status(400).json({ | ||
| error: errorHandler(err), | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,8 +9,8 @@ const { | |
| } = require('../controllers/auth'); | ||
| const { userSignupValidator } = require('../validator'); | ||
|
|
||
| router.post('/signup', userSignupValidator, signup); | ||
| router.post('/signin', signin); | ||
| router.get('/signout', signout); | ||
| router.post('/signup', userSignupValidator, signupss); | ||
|
Collaborator
Author
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.
Collaborator
Author
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. The function |
||
| router.post('/signin', signinss); | ||
|
Collaborator
Author
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.
Collaborator
Author
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. The function
Collaborator
Author
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. @CodeHawk Can you please this in simpler terms. Like very simple terms. Pretend im not a developer
Collaborator
Author
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. Here's a simple explanation: You've written |
||
| router.get('/signout', signoutss); | ||
|
Collaborator
Author
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.
|
||
|
|
||
| module.exports = router; | ||
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.
The docker run command is not checking if the environment variables are set before using them. This can lead to errors if the variables are not set. Consider adding checks to ensure the variables are set before using them.