mirror of
https://github.com/catppuccin/nvim
synced 2024-09-16 13:24:08 +02:00
ci: update palette workflow for @catppuccin/palette@v1.0.0
(#570)
This commit is contained in:
parent
c7cf3afe2e
commit
b901cf1445
2 changed files with 15 additions and 10 deletions
14
.github/scripts/update-palette.py
vendored
Normal file
14
.github/scripts/update-palette.py
vendored
Normal file
|
@ -0,0 +1,14 @@
|
|||
import json
|
||||
import urllib.request
|
||||
|
||||
url = "https://github.com/catppuccin/palette/raw/main/palette.json"
|
||||
|
||||
with urllib.request.urlopen(url) as response:
|
||||
flavors = json.loads(response.read().decode())
|
||||
|
||||
for flavor in flavors:
|
||||
with open(f"lua/catppuccin/palettes/{flavor}.lua", "w") as f:
|
||||
f.write("return {\n")
|
||||
for color in flavors[flavor]["colors"]:
|
||||
f.write(f'\t{color} = "{flavors[flavor]["colors"][color]["hex"]}",\n')
|
||||
f.write("}\n")
|
11
.github/workflows/palette.yml
vendored
11
.github/workflows/palette.yml
vendored
|
@ -13,16 +13,7 @@ jobs:
|
|||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Make changes to pull request
|
||||
run: |
|
||||
curl -o /tmp/palette.json https://raw.githubusercontent.com/catppuccin/palette/main/palette.json
|
||||
python -c "import json
|
||||
data = json.load(open('/tmp/palette.json'))
|
||||
|
||||
for flavour in data:
|
||||
with open('lua/catppuccin/palettes/{flavour}.lua'.format(flavour = flavour), 'w') as f:
|
||||
f.write('return {\n')
|
||||
for accent in data[flavour]: f.write('\t{accent} = \"{hex}\",\n'.format(accent = accent, hex = data[flavour][accent]['hex']))
|
||||
f.write('}\n')"
|
||||
run: python3 ./.github/scripts/update-palette.py
|
||||
|
||||
- name: Create Pull Request
|
||||
id: cpr
|
||||
|
|
Loading…
Reference in a new issue