From 1a95455c89d5947e70d01d0347a2fed36f6ec493 Mon Sep 17 00:00:00 2001 From: AlaRduTP <alardutp37259418@gmail.com> Date: Thu, 14 Mar 2024 01:13:14 +0800 Subject: [PATCH 1/2] fix: assignment to a constant variable --- .github/workflows/PR.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/PR.yml b/.github/workflows/PR.yml index 5dbfdfa7..0dccc894 100644 --- a/.github/workflows/PR.yml +++ b/.github/workflows/PR.yml @@ -19,7 +19,7 @@ jobs: const titleRegex = /^\[LAB(\d+)\] [a-zA-Z]?\d+$/; const match = title.match(titleRegex); - const labNumberStr = undefined; + let labNumberStr = undefined; if (match) { labNumberStr = match[1]; } else { From babfd1547d78229d8148f0774c9b2c4b6d583dde Mon Sep 17 00:00:00 2001 From: AlaRduTP <alardutp37259418@gmail.com> Date: Thu, 14 Mar 2024 01:33:25 +0800 Subject: [PATCH 2/2] fix: remove the redundant and faulty check --- .github/workflows/PR.yml | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/.github/workflows/PR.yml b/.github/workflows/PR.yml index 0dccc894..adade502 100644 --- a/.github/workflows/PR.yml +++ b/.github/workflows/PR.yml @@ -62,24 +62,3 @@ jobs: if (unchecked && unchecked.length > 0) { core.setFailed(`There are ${unchecked.length} unchecked items in the PR description.`); } - changed-files-check: - runs-on: ubuntu-latest - steps: - - name: Check no changes other than specific files - uses: actions/github-script@v5 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - const { owner, repo, number: issue_number } = context.issue; - const pr = await github.rest.pulls.get({ owner, repo, pull_number: issue_number }); - const files = await github.rest.pulls.listFiles({ owner, repo, pull_number: issue_number }); - const changedFiles = files.data.map((file) => file.filename); - echo changedFiles; - - const allowedFiles = [ - 'lab1/main_test.js', - 'lab2/main_test.js', - ]; - if (!changedFiles.every((file) => allowedFiles.includes(file))) { - core.setFailed('The PR contains changes to files other than the allowed files.'); - }