Skip to content

Commit

Permalink
Merge branch '312345678' into lab3
Browse files Browse the repository at this point in the history
  • Loading branch information
AlaRduTP authored Mar 13, 2024
2 parents 634d848 + babfd15 commit de16417
Showing 1 changed file with 1 addition and 22 deletions.
23 changes: 1 addition & 22 deletions .github/workflows/PR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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.');
}

0 comments on commit de16417

Please sign in to comment.