From 5e39174813e9c165c2d7d250bb11801fd1098f24 Mon Sep 17 00:00:00 2001 From: Vishakh Abhayan <94307781+vishakh-abhayan@users.noreply.github.com> Date: Fri, 1 Dec 2023 01:20:13 +0530 Subject: [PATCH 1/8] Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 57ae6ca..cbab413 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ # dump pr test + + +cool From 4f15b760c763d9eefc820ab71e69268f5a665a80 Mon Sep 17 00:00:00 2001 From: Vishakh Abhayan <94307781+vishakh-abhayan@users.noreply.github.com> Date: Fri, 1 Dec 2023 01:22:07 +0530 Subject: [PATCH 2/8] Create hey.md --- hey.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 hey.md diff --git a/hey.md b/hey.md new file mode 100644 index 0000000..8add6ac --- /dev/null +++ b/hey.md @@ -0,0 +1 @@ +helllo From 05bf6f4611a6538bf80534130558f776b2870a0c Mon Sep 17 00:00:00 2001 From: Vishakh Abhayan <94307781+vishakh-abhayan@users.noreply.github.com> Date: Fri, 1 Dec 2023 01:26:55 +0530 Subject: [PATCH 3/8] Update main.yml --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 10b72a6..d1d884d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,6 +2,7 @@ name: PR Verification Workflow permissions: issues: write + pull-requests: write on: pull_request: types: [opened, synchronize, reopened] From 6298a98b4f34c47fe6f659c3d82b105363bc9eb0 Mon Sep 17 00:00:00 2001 From: Vishakh Abhayan <94307781+vishakh-abhayan@users.noreply.github.com> Date: Fri, 1 Dec 2023 01:27:44 +0530 Subject: [PATCH 4/8] Create wsl.md --- wsl.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 wsl.md diff --git a/wsl.md b/wsl.md new file mode 100644 index 0000000..e4762de --- /dev/null +++ b/wsl.md @@ -0,0 +1 @@ +#hello From d83d084022a1544f6cdf8fa780102a8a50c54ab8 Mon Sep 17 00:00:00 2001 From: Vishakh Abhayan <94307781+vishakh-abhayan@users.noreply.github.com> Date: Fri, 1 Dec 2023 01:34:39 +0530 Subject: [PATCH 5/8] Create create_book.txt --- Adithya_Krishnan_book_app/add_book_features/create_book.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 Adithya_Krishnan_book_app/add_book_features/create_book.txt diff --git a/Adithya_Krishnan_book_app/add_book_features/create_book.txt b/Adithya_Krishnan_book_app/add_book_features/create_book.txt new file mode 100644 index 0000000..8f07373 --- /dev/null +++ b/Adithya_Krishnan_book_app/add_book_features/create_book.txt @@ -0,0 +1 @@ +Adithya_Krishnan_book_app/add_book_features/create_book.txt From e329191c166e0a0f1fef133ae5e5bcf86ddf21c2 Mon Sep 17 00:00:00 2001 From: Vishakh Abhayan <94307781+vishakh-abhayan@users.noreply.github.com> Date: Fri, 1 Dec 2023 01:36:51 +0530 Subject: [PATCH 6/8] Create ejdsaxio.txt --- Adithya_Krishnan_book_app/add_book_features/ejdsaxio.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 Adithya_Krishnan_book_app/add_book_features/ejdsaxio.txt diff --git a/Adithya_Krishnan_book_app/add_book_features/ejdsaxio.txt b/Adithya_Krishnan_book_app/add_book_features/ejdsaxio.txt new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/Adithya_Krishnan_book_app/add_book_features/ejdsaxio.txt @@ -0,0 +1 @@ + From f6f4a1eb45dc6f31015668695a19f6963833522a Mon Sep 17 00:00:00 2001 From: Vishakh Abhayan <94307781+vishakh-abhayan@users.noreply.github.com> Date: Fri, 1 Dec 2023 01:41:03 +0530 Subject: [PATCH 7/8] Update main.yml --- .github/workflows/main.yml | 31 +++++++------------------------ 1 file changed, 7 insertions(+), 24 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d1d884d..fbf37f5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,6 +3,7 @@ name: PR Verification Workflow permissions: issues: write pull-requests: write + on: pull_request: types: [opened, synchronize, reopened] @@ -20,38 +21,19 @@ jobs: #!/bin/bash set -e - # Function to check file content - function check_file_content() { - if [ ! -s "$1" ]; then - echo "File $1 is empty" - echo "::set-output name=valid::false" - return 1 - fi - } - VALID=true EXPECTED_PATH_PATTERN="^.*_book_app/add_book_features/(create_book\.txt|list_all_books\.txt)$" - # Loop through all files in the PR for file in $(git diff --name-only origin/main...HEAD); do echo "Checking $file" - # Check if the file path matches the expected pattern - if [[ ! $file =~ $EXPECTED_PATH_PATTERN ]]; then - echo "Invalid file path for $file" + if [[ ! $file =~ $EXPECTED_PATH_PATTERN ]] || [ ! -s "$file" ]; then + echo "Invalid file path or empty file: $file" VALID=false - break fi - - # Check file content - check_file_content "$file" || VALID=false done - if [ "$VALID" = true ]; then - echo "::set-output name=valid::true" - else - echo "::set-output name=valid::false" - fi + echo "::set-output name=valid::$VALID" - name: Label PR if: always() @@ -61,11 +43,12 @@ jobs: script: | const isValid = ${{ steps.verify_files.outputs.valid }}; const prNumber = context.payload.pull_request.number; - const labels = isValid ? ['valid'] : ['invalid']; + const label = isValid === 'true' ? 'valid' : 'invalid'; github.rest.issues.addLabels({ owner: context.repo.owner, repo: context.repo.repo, issue_number: prNumber, - labels: labels + labels: [label] }); + From 1247d2191d039a4d13bfcfaaebb20c07ccbdb0e9 Mon Sep 17 00:00:00 2001 From: Vishakh Abhayan <94307781+vishakh-abhayan@users.noreply.github.com> Date: Fri, 1 Dec 2023 01:41:48 +0530 Subject: [PATCH 8/8] Create rr.txt --- alongppt/rr.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 alongppt/rr.txt diff --git a/alongppt/rr.txt b/alongppt/rr.txt new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/alongppt/rr.txt @@ -0,0 +1 @@ +