mirror of
https://github.com/zen-browser/theme-store.git
synced 2025-07-07 17:05:31 +02:00
chore: Update create-theme workflow to handle HTTPS URLs in submit-theme script
This commit is contained in:
parent
9adc322c37
commit
980bdc047f
2 changed files with 6 additions and 2 deletions
1
.github/workflows/create-theme.yml
vendored
1
.github/workflows/create-theme.yml
vendored
|
@ -70,6 +70,7 @@ jobs:
|
||||||
- name: Export creation output
|
- name: Export creation output
|
||||||
if: failure()
|
if: failure()
|
||||||
run: |
|
run: |
|
||||||
|
cat error.log
|
||||||
echo "CREATION_OUTPUT=$(cat error.log)" >> $GITHUB_ENV
|
echo "CREATION_OUTPUT=$(cat error.log)" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Show error message
|
- name: Show error message
|
||||||
|
|
|
@ -41,7 +41,10 @@ def validate_url(url, allow_empty=False):
|
||||||
if allow_empty and len(url) == 0:
|
if allow_empty and len(url) == 0:
|
||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
urllib.parse.urlparse(url)
|
result = urllib.parse.urlparse(url)
|
||||||
|
if result.scheme != 'https':
|
||||||
|
print("URL must be HTTPS.", file=sys.stderr)
|
||||||
|
exit(1)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print("URL is invalid.", file=sys.stderr)
|
print("URL is invalid.", file=sys.stderr)
|
||||||
print(e, file=sys.stderr)
|
print(e, file=sys.stderr)
|
||||||
|
@ -103,7 +106,7 @@ def validate_description(description):
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
def download_image(image_url, image_path):
|
def download_image(image_url, image_path):
|
||||||
response = requests.get(image_url)
|
response = requests.get(image_url, headers={'User-Agent': 'Epicture'})
|
||||||
if response.status_code != 200:
|
if response.status_code != 200:
|
||||||
print("Image URL is invalid.", file=sys.stderr)
|
print("Image URL is invalid.", file=sys.stderr)
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue