Skip to content

Commit

Permalink
Merge branch 'production' into import-figma-icons
Browse files Browse the repository at this point in the history
  • Loading branch information
yceballost authored Oct 15, 2023
2 parents a0864d9 + 33a6fc7 commit 0043dd7
Show file tree
Hide file tree
Showing 3 changed files with 1,733 additions and 1,658 deletions.
2 changes: 1 addition & 1 deletion .github/md-generator/md-generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def create_bar_string(percentage, comp_string):

if __name__ == '__main__':
path = sys.argv[1]
brands = read_folder(path)
brands = [folder for folder in os.listdir(path) if os.path.isdir(os.path.join(path, folder))]
root = os.path.basename(path)
dictionary = {}
file_content = "![Mistica Icons](.github/resources/mistica-icons-light.svg#gh-light-mode-only)" + BREAK + "![Mistica Icons](.github/resources/mistica-icons-dark.svg#gh-dark-mode-only)" + BREAK + BREAK + "## What is this? " + BREAK + BREAK + "Mística Icons is a multibrand icon system that contains all icons that is working in [Mistica Design System](https://github.com/Telefonica/mistica) now. " + BREAK + BREAK + "Mistica support [Brand Factory icons](https://brandfactory.telefonica.com/document/1086#/nuestra-identidad/iconos). This set of icons are a big list of different icons and style that Brand Team worked to be used through Telefonica applications." + BREAK + BREAK + "If you have any question, please you can ask directly in the app of Microsoft Teams, in [Mistica Team](https://teams.microsoft.com/l/team/19%3ad2e3607a32ec411b8bf492f43cd0fe0c%40thread.tacv2/conversations?groupId=e265fe99-929f-45d1-8154-699649674a40&tenantId=9744600e-3e04-492e-baa1-25ec245c6f10). " + \
Expand Down
76 changes: 76 additions & 0 deletions .github/workflows/keywords-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Check icons keywords

on:
push:
paths:
- "icons/**"
pull_request:
branches:
- production
paths:
- "icons/**"

jobs:
check_icons:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: List SVG files
run: |
ICONS_DIR="icons" # Reemplaza con la ubicación real de tu carpeta de iconos
echo "Listing SVG files..."
# Utiliza 'find' para encontrar todos los archivos SVG en la carpeta de iconos
find $ICONS_DIR -type f -name "*.svg" |
# Utiliza 'basename' para obtener solo el nombre de archivo sin la ruta
xargs -I {} basename {} |
# Utiliza 'sed' para quitar las partes "-filled", "-light", "-regular" y la extensión ".svg"
sed 's/\(-filled\|-light\|-regular\)\.svg//' |
# Utiliza 'sort -u' para obtener una lista única de nombres de archivo
sort -u > icons.txt
# Muestra el contenido del archivo icons.txt en la consola
cat icons.txt
continue-on-error: false

- name: Read JSON file
run: |
JSON_FILE="icons/icons-keywords.json"
echo "Reading JSON file..."
cat $JSON_FILE > data.json
continue-on-error: true

- name: Extract keywords
run: |
echo "Extracting keywords from JSON..."
# Usamos jq para extraer las claves del JSON y guardarlas en keywords.txt
cat data.json | jq -r 'keys[]' > keywords.txt
# Mostramos el contenido de keywords.txt para verificar que se han extraído correctamente
cat keywords.txt
continue-on-error: true

- name: Compare with Keywords
run: |
echo "Comparing icon names with keywords from JSON..."
for icon_name in $(cat icons.txt); do
if ! grep -q "\"$icon_name\":" data.json; then
echo "Icon name '$icon_name' is missing in the JSON keywords."
exit 1 # Terminar la ejecución con un código de error
fi
done
continue-on-error: false

- name: Cleanup
run: |
rm data.json
rm icons.txt
rm keywords.txt
continue-on-error: true
Loading

0 comments on commit 0043dd7

Please sign in to comment.