Skip to content

Commit d1e6f35

Browse files
Merge branch 'trial-testing:main' into main
2 parents df3f190 + b9de426 commit d1e6f35

File tree

2 files changed

+60
-60
lines changed

2 files changed

+60
-60
lines changed

.github/workflows/auth.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# .github/workflows/pr-validate.yml
2-
name: PR Validation via OIDC
2+
name: PR Validation via OIDC !!!!!!!!!!!!!!!!!!!!!
33

44
on:
55
pull_request_target:
@@ -86,7 +86,7 @@ jobs:
8686
8787
echo "Sending JSON payload to API"
8888
89-
response=$(curl -s -X POST "$API_URL" \\
89+
response=$(curl -s -X POST "$API_URL" \
9090
-H "Authorization: Bearer $TOKEN"
9191
-H "Content-Type: application/json" \
9292
--data-binary "@$JSON_PAYLOAD_PATH")
Lines changed: 58 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,65 @@
1-
name: pull_request_target
1+
# name: pull_request_target
22

3-
on:
4-
pull_request_target:
5-
types: [opened, synchronize]
3+
# on:
4+
# pull_request_target:
5+
# types: [opened, synchronize]
66

7-
jobs:
8-
send-json-files:
9-
runs-on: ubuntu-latest
10-
steps:
11-
- name: Checkout PR code
12-
uses: actions/checkout@v3
13-
with:
14-
fetch-depth: 0
15-
ref: ${{ github.event.pull_request.head.ref }}
16-
repository: ${{ github.event.pull_request.head.repo.full_name }}
7+
# jobs:
8+
# send-json-files:
9+
# runs-on: ubuntu-latest
10+
# steps:
11+
# - name: Checkout PR code
12+
# uses: actions/checkout@v3
13+
# with:
14+
# fetch-depth: 0
15+
# ref: ${{ github.event.pull_request.head.ref }}
16+
# repository: ${{ github.event.pull_request.head.repo.full_name }}
1717

18-
- name: Get changed JSON files and contents to send to API endpoint
19-
id: prepare_json_files
20-
run: |
21-
echo "Collecting changed JSON files..."
22-
BASE="${{ github.event.pull_request.base.sha }}"
23-
HEAD="${{ github.event.pull_request.head.sha }}"
18+
# - name: Get changed JSON files and contents to send to API endpoint
19+
# id: prepare_json_files
20+
# run: |
21+
# echo "Collecting changed JSON files..."
22+
# BASE="${{ github.event.pull_request.base.sha }}"
23+
# HEAD="${{ github.event.pull_request.head.sha }}"
2424

25-
mapfile -t files < <(git diff --name-only "$BASE" "$HEAD" | grep '\.json$')
26-
echo "Changed JSON files: ${files[@]}"
25+
# mapfile -t files < <(git diff --name-only "$BASE" "$HEAD" | grep '\.json$')
26+
# echo "Changed JSON files: ${files[@]}"
2727

28-
if [ ${#files[@]} -eq 0 ]; then
29-
echo "No JSON files changed in this PR."
30-
echo "JSON_PAYLOAD_PATH=empty" >> $GITHUB_ENV
31-
exit 0
32-
fi
28+
# if [ ${#files[@]} -eq 0 ]; then
29+
# echo "No JSON files changed in this PR."
30+
# echo "JSON_PAYLOAD_PATH=empty" >> $GITHUB_ENV
31+
# exit 0
32+
# fi
3333

34-
json_array="["
35-
for file in "${files[@]}"; do
36-
if [ -f "$file" ]; then
37-
if jq -e . "$file" > /dev/null 2>&1; then
38-
content=$(jq -c . < "$file")
39-
json_array+="{\"filename\": \"${file}\", \"content\": $content},"
40-
else
41-
echo "❌ Invalid JSON structure in file: $file"
42-
exit 1
43-
fi
44-
fi
45-
done
46-
json_array="${json_array%,}]"
47-
echo "$json_array" > files_payload.json
48-
echo "JSON_PAYLOAD_PATH=files_payload.json" >> $GITHUB_ENV
34+
# json_array="["
35+
# for file in "${files[@]}"; do
36+
# if [ -f "$file" ]; then
37+
# if jq -e . "$file" > /dev/null 2>&1; then
38+
# content=$(jq -c . < "$file")
39+
# json_array+="{\"filename\": \"${file}\", \"content\": $content},"
40+
# else
41+
# echo "❌ Invalid JSON structure in file: $file"
42+
# exit 1
43+
# fi
44+
# fi
45+
# done
46+
# json_array="${json_array%,}]"
47+
# echo "$json_array" > files_payload.json
48+
# echo "JSON_PAYLOAD_PATH=files_payload.json" >> $GITHUB_ENV
4949

50-
- name: Send JSON files to API and check response
51-
if: env.JSON_PAYLOAD_PATH != 'empty'
52-
env:
53-
API_URL: https://valid1-e2akhdekg6a7a2ch.canadacentral-01.azurewebsites.net/
54-
run: |
55-
echo "Sending JSON payload to API"
56-
response=$(curl -s -X POST "$API_URL" \
57-
-H "Content-Type: application/json" \
58-
--data-binary "@$JSON_PAYLOAD_PATH")
59-
status=$(jq -r '.status' <<< "$response")
60-
message=$(jq -r '.message' <<< "$response")
61-
if [ "$status" != "passed" ]; then
62-
echo "❌ Test Fail : $message"
63-
exit 1
64-
fi
65-
echo "✅ $message"
50+
# - name: Send JSON files to API and check response
51+
# if: env.JSON_PAYLOAD_PATH != 'empty'
52+
# env:
53+
# API_URL: https://valid1-e2akhdekg6a7a2ch.canadacentral-01.azurewebsites.net/
54+
# run: |
55+
# echo "Sending JSON payload to API"
56+
# response=$(curl -s -X POST "$API_URL" \
57+
# -H "Content-Type: application/json" \
58+
# --data-binary "@$JSON_PAYLOAD_PATH")
59+
# status=$(jq -r '.status' <<< "$response")
60+
# message=$(jq -r '.message' <<< "$response")
61+
# if [ "$status" != "passed" ]; then
62+
# echo "❌ Test Fail : $message"
63+
# exit 1
64+
# fi
65+
# echo "✅ $message"

0 commit comments

Comments
 (0)