Skip to content

Commit

Permalink
fix: go old way
Browse files Browse the repository at this point in the history
  • Loading branch information
adhikara13 committed Dec 16, 2023
1 parent 7a5d3cb commit 16d02ad
Showing 1 changed file with 4 additions and 22 deletions.
26 changes: 4 additions & 22 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,10 @@ jobs:

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

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 14

- name: Install Dependencies
run: npm install node-fetch
uses: actions/checkout@v3

- name: Fetch and Save Data
run: |
node -e "const fetch = require('node-fetch'); \
const fs = require('fs'); \
fetch('https://vdnh.ru/local/templates/v3_new_header/js/places-s1.js') \
.then(response => response.text()) \
.then(data => { \
const jsonData = data.replace(/^var places = |;$/g, ''); \
const backupData = JSON.stringify(jsonData, null, 2); \
fs.writeFileSync('backup.json', backupData); \
}) \
.catch(error => { \
console.error('Error fetching data:', error); \
process.exit(1); \
})"
curl -sS 'https://vdnh.ru/local/templates/v3_new_header/js/places-s1.js' \
| sed -E 's/^var places = |;$//g' \
> backup.json

0 comments on commit 16d02ad

Please sign in to comment.