From 16d02ad5bee20c958b650d050a53cb40cc6dd2c1 Mon Sep 17 00:00:00 2001 From: Achmad Adhikara <44716348+adhikara13@users.noreply.github.com> Date: Sat, 16 Dec 2023 22:56:09 +0000 Subject: [PATCH] fix: go old way --- .github/workflows/main.yml | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 892cb47..fd8257b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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