Skip to content

Commit 3341f16

Browse files
author
LE SAULNIER Kevin
committed
fix: remove url input validation for now
Signed-off-by: LE SAULNIER Kevin <[email protected]>
1 parent 0ff73c4 commit 3341f16

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

.github/workflows/dispatch-release.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,21 @@ jobs:
3232
echo ::add-mask::$GH_TOKEN
3333
echo "GH_TOKEN=$GH_TOKEN" >> $GITHUB_ENV
3434
35+
- name: Validate pat-token input
36+
run: |
37+
scopes=$(gh api -i user 2>&1 | grep -i 'x-oauth-scopes:' | cut -d' ' -f2-)
38+
39+
if [[ -n "$scopes" && "$scopes" == *"workflow"* ]]; then
40+
echo "✅ Token is valid and has the 'workflow' scope"
41+
elif [[ -n "$scopes" ]]; then
42+
echo "⚠️ Token is valid but missing the 'workflow' scope"
43+
exit 1
44+
else
45+
echo "❌ Invalid token"
46+
exit 1
47+
fi
48+
env:
49+
GH_TOKEN: ${{ env.GH_TOKEN }}
3550

3651
- name: Load repo list from file or input
3752
id: load_repos

.github/workflows/prepare-release.yml

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -42,24 +42,9 @@ jobs:
4242
echo "✅ Valid version"
4343
else
4444
echo "❌ Invalid version"
45+
exit 1
4546
fi
4647
47-
REPOS_TO_RELEASE_INPUT="${{ github.event.inputs.repos_to_release }}"
48-
CONFIG_FILE=".github/config/repos-to-release.txt"
49-
50-
# Convert multi-line input to table
51-
IFS=$'\n' read -d '' -r -a urls <<< "$REPOS_TO_RELEASE_INPUT"
52-
53-
# Check earch url is contained in config file
54-
for url in "${urls[@]}"; do
55-
if ! grep -Fxq "$url" "$CONFIG_FILE"; then
56-
echo "❌ URL '$url' is unauthorized"
57-
exit 1
58-
fi
59-
done
60-
61-
echo "✅ All URLs are valid"
62-
6348
- uses: actions/create-github-app-token@21cfef2b496dd8ef5b904c159339626a10ad380e # v1 v1.11.6
6449
id: app-token
6550
name: Generate app token

0 commit comments

Comments
 (0)