Skip to content

Commit c08c3e1

Browse files
committed
Testing phase1-a
1 parent 4dbb451 commit c08c3e1

1 file changed

Lines changed: 27 additions & 14 deletions

File tree

.github/workflows/validate.yaml

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11

22
on:
33
pull_request:
4-
# types: [opened, synchronize, reopened, labeled, unlabeled]
54
types: [labeled]
6-
pull_request_target:
7-
types: [labeled]
8-
95

106
permissions:
11-
issues: write # Allows the token to modify issues (needed for label management)
12-
pull-requests: write # Allows the token to interact with pull requests
7+
pull-requests: write
138

149
concurrency:
1510
group: ${{ github.workflow }}-${{ github.ref }}
@@ -33,21 +28,39 @@ jobs:
3328
echo "Running validation because 'full validation' label was added"
3429
# Add your validation logic here (e.g., linting, testing)
3530
36-
remove-label:
37-
needs: validate
38-
if: always() # Ensures this runs even if validation fails
39-
runs-on: ubuntu-latest
31+
sleep 10
32+
exit 0
4033
41-
steps:
42-
- name: Remove 'needs-validation' label
34+
- name: Remove label
35+
if: always()
4336
run: |
4437
PR_NUMBER=${{ github.event.pull_request.number }}
4538
REPO=${{ github.repository }}
4639
LABEL="full validation"
40+
41+
# URL-encodes the label by replacing special characters with their percent-encoded equivalents.
4742
ENCODED_LABEL=$(printf "%s" "$LABEL" | sed -e 's/ /%20/g' -e 's/:/%3A/g' -e 's/\//%2F/g' -e 's/?/%3F/g' -e 's/&/%26/g' -e 's/=/%3D/g')
4843
49-
echo $ENCODED_LABEL
5044
echo "https://api.github.com/repos/$REPO/issues/$PR_NUMBER/labels/$ENCODED_LABEL"
5145
curl -X DELETE -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
5246
-H "Accept: application/vnd.github.v3+json" \
53-
"https://api.github.com/repos/$REPO/issues/$PR_NUMBER/labels/${ENCODED_LABEL}"
47+
"https://api.github.com/repos/$REPO/issues/$PR_NUMBER/labels/${ENCODED_LABEL}"
48+
49+
# remove-label:
50+
# needs: validate
51+
# if: always() # Ensures this runs even if validation fails
52+
# runs-on: ubuntu-latest
53+
54+
# steps:
55+
# - name: Remove 'needs-validation' label
56+
# run: |
57+
# PR_NUMBER=${{ github.event.pull_request.number }}
58+
# REPO=${{ github.repository }}
59+
# LABEL="full validation"
60+
# ENCODED_LABEL=$(printf "%s" "$LABEL" | sed -e 's/ /%20/g' -e 's/:/%3A/g' -e 's/\//%2F/g' -e 's/?/%3F/g' -e 's/&/%26/g' -e 's/=/%3D/g')
61+
62+
# echo $ENCODED_LABEL
63+
# echo "https://api.github.com/repos/$REPO/issues/$PR_NUMBER/labels/$ENCODED_LABEL"
64+
# curl -X DELETE -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
65+
# -H "Accept: application/vnd.github.v3+json" \
66+
# "https://api.github.com/repos/$REPO/issues/$PR_NUMBER/labels/${ENCODED_LABEL}"

0 commit comments

Comments
 (0)