Skip to content

Commit

Permalink
writing data to yaml file
Browse files Browse the repository at this point in the history
  • Loading branch information
KalpanaReddyC committed Sep 7, 2023
1 parent 95a3396 commit 02e0738
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
Empty file added .github/repos/repo-settings.yml
Empty file.
9 changes: 9 additions & 0 deletions .github/workflows/issue-forms-body-parser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,20 @@ jobs:
run: |
git config user.name "GitHub Actions"
git config user.email noreply@github.com
- name: Install dependencies
run: npm install js-yaml

- name: Convert JSON to YAML
run: |
node json-to-yaml.js
cat yaml-data.yml
- name: Create and Push New Branch
run: |
git checkout -b test-branch
git add extracted-data.json
git add yaml-data.yml
git commit -m "Add extracted-data.json"
git push --set-upstream origin test-branch
env:
Expand Down
15 changes: 15 additions & 0 deletions json-to-yaml.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const yaml = require('js-yaml');
const fs = require('fs');


const jsonData = {
"name": "first-repo",
"has_wiki": true,
"has_projects": true,
"has_issues": false
};

const yamlData = yaml.dump(jsonData);

// Write the extracted data to a yaml file
fs.writeFileSync('yaml-data.yml', yamlData);

0 comments on commit 02e0738

Please sign in to comment.