Skip to content

Commit

Permalink
Checks sample content type
Browse files Browse the repository at this point in the history
  • Loading branch information
dayanch96 committed Dec 8, 2024
1 parent 8cf717f commit 00bb39a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,11 @@ jobs:

- name: Validate IPA URL
run: |
response=$(curl -sI "${{ inputs.ipa_url }}")
content_type=$(echo "$response" | grep -i "Content-Type" | awk '{print $2}' | tr -d '\r')
if [[ "$content_type" != "application/octet-stream" ]]; then
echo "Direct link to the IPA file required. Entered link is not a direct download or does not point to an IPA file."
curl -r 0-1023 -o sample.part "${{ inputs.ipa_url }}" > /dev/null 2>&1
file_type=$(file --mime-type -b sample.part)
if [[ "$file_type" != "application/x-ios-app" ]]; then
echo "ERROR: The file is not a valid IPA file. Please ensure that you have provided a direct link to the file, not a web page."
exit 1
fi
Expand Down
18 changes: 10 additions & 8 deletions .github/workflows/ytp_beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,19 +75,21 @@ jobs:

- name: Validate IPA URL
run: |
response=$(curl -sI "${{ inputs.ipa_url }}")
content_type=$(echo "$response" | grep -i "Content-Type" | awk '{print $2}' | tr -d '\r')
if [[ "$content_type" != "application/octet-stream" ]]; then
echo "Direct link to the IPA file required. Entered link is not a direct download or does not point to an IPA file."
curl -r 0-1023 -o sample.part "${{ inputs.ipa_url }}" > /dev/null 2>&1
file_type=$(file --mime-type -b sample.part)
if [[ "$file_type" != "application/x-ios-app" ]]; then
echo "ERROR: The file is not a valid IPA file. Please ensure that you have provided a direct link to the file, not a web page."
exit 1
fi
- name: Validate Tweak URL
run: |
response=$(curl -sI "${{ inputs.tweak_url }}")
content_type=$(echo "$response" | grep -i "Content-Type" | awk '{print $2}' | tr -d '\r')
if [[ "$content_type" != "application/octet-stream" ]]; then
echo "Direct link to the tweak file required. Entered link is not a direct download or does not point to a DEB file."
curl -r 0-1023 -o debsample.part "${{ inputs.tweak_url }}" > /dev/null 2>&1
file_type=$(file --mime-type -b debsample.part)
if [[ "$file_type" != "application/vnd.debian.binary-package" ]]; then
echo "ERROR: The file is not a valid DEB file. Please ensure that you have provided a direct link to the file, not a web page."
exit 1
fi
Expand Down

0 comments on commit 00bb39a

Please sign in to comment.