-
Notifications
You must be signed in to change notification settings - Fork 1
50 lines (38 loc) · 1.21 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: Convert Excel to JavaScript Object
on:
push:
branches: ['main']
paths:
- '/cloudnativetools.xlsx' # This ensures the action runs only when the Excel file changes.
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
jobs:
convert_excel_to_js:
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.8'
- name: Install Python dependencies
run: pip install pandas openpyxl
- name: Convert Excel to JSON and write to JS file
run: python3 convert_excel_to_json.py
- name: Commit and push changes
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add -A
git commit -m "Convert Excel to JavaScript object" -a || echo "No changes to commit"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
EXCEL_PATH: 'cloudnativetools.xlsx'
JS_PATH: 'entries.js'