Skip to content

Commit

Permalink
Validates content type
Browse files Browse the repository at this point in the history
  • Loading branch information
dayanch96 committed Dec 8, 2024
1 parent 1072e0d commit 8cf717f
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 6 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,18 @@ jobs:
path: main
submodules: recursive

- name: Hide sensitive inputs
uses: levibostian/action-hide-sensitive-inputs@v1

- 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."
exit 1
fi
- name: Install Dependencies
run: brew install make ldid

Expand Down Expand Up @@ -115,9 +127,6 @@ jobs:
deb_url="https://github.com/dayanch96/YTLite/releases/download/v${{ inputs.tweak_version }}/com.dvntm.ytlite_${{ inputs.tweak_version }}_iphoneos-arm.deb"
wget "$deb_url" --no-verbose -O ${{ github.workspace }}/ytplus.deb
- name: Hide sensitive inputs
uses: levibostian/action-hide-sensitive-inputs@v1

- name: Download YouTube
id: download_youtube
run: wget "${{ inputs.ipa_url }}" --no-verbose -O ${{ github.workspace }}/youtube.ipa
Expand Down
24 changes: 21 additions & 3 deletions .github/workflows/ytp_beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,27 @@ jobs:
path: main
submodules: recursive

- name: Hide sensitive inputs
uses: levibostian/action-hide-sensitive-inputs@v1

- 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."
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."
exit 1
fi
- name: Install Dependencies
run: brew install make ldid

Expand Down Expand Up @@ -109,9 +130,6 @@ jobs:
- name: Install cyan
run: pipx install --force https://github.com/asdfzxcvbn/pyzule-rw/archive/main.zip

- name: Hide sensitive inputs
uses: levibostian/action-hide-sensitive-inputs@v1

- name: Download YouTube
id: download_youtube
run: wget "${{ inputs.ipa_url }}" --no-verbose -O ${{ github.workspace }}/youtube.ipa
Expand Down

0 comments on commit 8cf717f

Please sign in to comment.