chore: Update create-theme workflow to capture error logs

This commit is contained in:
Mauro Balades 2024-08-15 20:52:01 +02:00
parent 002a1f1a2a
commit 881b84875c
2 changed files with 12 additions and 8 deletions

View file

@ -57,6 +57,10 @@ jobs:
--styles "${THEME_STYLES}" \ --styles "${THEME_STYLES}" \
--readme "${THEME_README}" \ --readme "${THEME_README}" \
--author "${THEME_AUTHOR}" 2> error.log --author "${THEME_AUTHOR}" 2> error.log
- name: Export creation output
if: failure()
run: |
echo "CREATION_OUTPUT=$(cat error.log)" >> $GITHUB_ENV echo "CREATION_OUTPUT=$(cat error.log)" >> $GITHUB_ENV
- name: Show error message - name: Show error message
@ -70,7 +74,7 @@ jobs:
Sorry about that! There was an error creating the theme. Please try again or contact the maintainers for help. Sorry about that! There was an error creating the theme. Please try again or contact the maintainers for help.
``` ```
${{ steps.export.outputs.CREATION_OUTPUT }} ${{ env.CREATION_OUTPUT }}
``` ```
- if: success() - if: success()

View file

@ -15,18 +15,18 @@ def get_static_asset(theme_id, asset):
def main(): def main():
parser = argparse.ArgumentParser(description='Submit a theme to the theme repo.') parser = argparse.ArgumentParser(description='Submit a theme to the theme repo.')
parser.add_argument('name', type=str, help='The theme to submit.') parser.add_argument('--name', type=str, help='The theme to submit.')
parser.add_argument('description', type=str, help='The description of the theme.') parser.add_argument('--description', type=str, help='The description of the theme.')
parser.add_argument('homepage', type=str, help='The homepage of the theme.') parser.add_argument('--homepage', type=str, help='The homepage of the theme.')
parser.add_argument('style', type=str, help='The style of the theme.') parser.add_argument('--styles', type=str, help='The style of the theme.')
parser.add_argument('readme', type=str, help='The README of the theme.') parser.add_argument('--readme', type=str, help='The README of the theme.')
parser.add_argument('author', type=str, help='The author of the theme.') parser.add_argument('--author', type=str, help='The author of the theme.')
args = parser.parse_args() args = parser.parse_args()
name = args.name name = args.name
description = args.description description = args.description
homepage = args.homepage homepage = args.homepage
style = args.style style = args.styles
readme = args.readme readme = args.readme
author = args.author author = args.author