We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c895269 commit 22a9521Copy full SHA for 22a9521
.github/workflows/lab-autograding.yml
@@ -44,12 +44,10 @@ jobs:
44
45
const files = await github.rest.pulls.listFiles({ owner, repo, pull_number: issue_number });
46
const changedFiles = files.data.map((file) => file.filename);
47
- const allowedFiles = [
48
- `lab${labNumber}/main_test.js`,
49
- ];
50
- // if (!changedFiles.every((file) => allowedFiles.includes(file))) {
51
- // core.setFailed('The PR contains changes to files other than the allowed files.');
52
- // }
+ const allowedFileRegex = /^lab\d+\/main_test.js$/;
+ if (!changedFiles.every((file) => allowedFileRegex.test(file))) {
+ core.setFailed('The PR contains changes to files other than the allowed files.');
+ }
53
return labNumber;
54
- name: Grading
55
run: |
0 commit comments