From 47453fc79696d8c75a3b86d550b1264a4d238f7f Mon Sep 17 00:00:00 2001 From: stasel <2033301+stasel@users.noreply.github.com> Date: Wed, 24 Dec 2025 15:51:55 +0100 Subject: [PATCH 1/2] Fixed github action? --- .github/workflows/grade-assignment.yml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/grade-assignment.yml b/.github/workflows/grade-assignment.yml index 5a46d64..1f0ba1e 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 From b817442231d449bb5dc6068d8c2d43b652cb7b61 Mon Sep 17 00:00:00 2001 From: stasel <2033301+stasel@users.noreply.github.com> Date: Wed, 24 Dec 2025 15:27:48 +0100 Subject: [PATCH 2/2] tsest --- .github/workflows/grade-assignment.yml | 1 - task-1/setup.sh | 3 ++- task-2/github-username.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/grade-assignment.yml b/.github/workflows/grade-assignment.yml index 04545c2..0fac044 100644 --- a/.github/workflows/grade-assignment.yml +++ b/.github/workflows/grade-assignment.yml @@ -42,7 +42,6 @@ jobs: const output = `${{ steps.output.outputs.results }}`; const exitCode = '${{ steps.test.outputs.exit_code }}'; const status = exitCode === '0' ? '✅ Passed' : '❌ Failed'; - github.rest.issues.createComment({ issue_number: context.issue.number, owner: context.repo.owner, diff --git a/task-1/setup.sh b/task-1/setup.sh index 4067509..81eef62 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?" \ 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