File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change 26
26
with :
27
27
submodules : false
28
28
29
+ - name : Validate inputs
30
+ run : |
31
+ if ! date -d "${{ github.event.inputs.target_date }}" "+%Y-%m-%dT%H:%M:%SZ" >/dev/null 2>&1; then
32
+ echo "❌ Invalid date"
33
+ exit 1
34
+ fi
35
+ echo "✅ Valid date"
36
+
37
+ if [[ "github.event.inputs.release-version" =~ ^[0-9]+\.[0-9]+$ ]]; then
38
+ echo "✅ Valid version"
39
+ else
40
+ echo "❌ Invalid version"
41
+ fi
42
+
43
+ REPOS_TO_RELEASE_INPUT="${{ github.event.inputs.repos_to_release }}"
44
+ CONFIG_FILE=".github/config/repos-to-release.txt"
45
+
46
+ # Convert multi-line input to table
47
+ IFS=$'\n' read -d '' -r -a urls <<< "$REPOS_TO_RELEASE_INPUT"
48
+
49
+ # Check earch url is contained in config file
50
+ for url in "${urls[@]}"; do
51
+ if ! grep -Fxq "$url" "$CONFIG_FILE"; then
52
+ echo "❌ URL '$url' is unauthorized"
53
+ exit 1
54
+ fi
55
+ done
56
+
57
+ echo "✅ All URLs are valid"
58
+
29
59
- uses : actions/create-github-app-token@21cfef2b496dd8ef5b904c159339626a10ad380e # v1 v1.11.6
30
60
id : app-token
31
61
name : Generate app token
You can’t perform that action at this time.
0 commit comments