diff --git a/.github/workflows/grade-assignment.yml b/.github/workflows/grade-assignment.yml index 5a46d64..a1c9150 100644 --- a/.github/workflows/grade-assignment.yml +++ b/.github/workflows/grade-assignment.yml @@ -1,7 +1,7 @@ name: Grade Assignment on: - pull_request: + pull_request_target: branches: - main @@ -10,15 +10,18 @@ jobs: runs-on: ubuntu-latest permissions: pull-requests: write + issues: write steps: - name: Checkout code uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: "24" + node-version: "lts/*" - name: Run tests working-directory: .hyf @@ -51,12 +54,16 @@ jobs: const pass = '${{ steps.score.outputs.pass }}' === 'true'; const passingScore = '${{ steps.score.outputs.passing_score }}'; const status = pass ? '✅ Passed' : '❌ Failed'; - github.rest.issues.createComment({ issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - body: `## Assignment Grade ${status}\n\n**Score:** ${score}/${passingScore}\n\n
\nTest Details\n\n\`\`\`\n${output}\n\`\`\`\n\n
` + body: `## !Assignment score ${score} / 100\n\n + **Score:** ${score}/${passingScore}\n\n +
\n + Test Details\n\n + \`\`\`\n${output}\n\`\`\`\n\n +
` }); - name: Fail if tests failed diff --git a/task-1/setup.sh b/task-1/setup.sh index 4067509..28e41a8 100644 --- a/task-1/setup.sh +++ b/task-1/setup.sh @@ -1 +1,2 @@ -# Write your code here \ No newline at end of file +# Write your code here +echo "JavaScript works?saa" \ No newline at end of file diff --git a/task-2/github-username.txt b/task-2/github-username.txt index 5eabca7..2b70fb8 100644 --- a/task-2/github-username.txt +++ b/task-2/github-username.txt @@ -1 +1 @@ - \ No newline at end of file +stasel \ No newline at end of file