Skip to content

Commit

Permalink
changed on the script
Browse files Browse the repository at this point in the history
  • Loading branch information
binni979 committed Jul 8, 2024
1 parent 047ed20 commit 7e30ebd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 28 deletions.
20 changes: 7 additions & 13 deletions .github/workflows/banner.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,13 @@ jobs:
- name: GitHub Issue to JSON
uses: actions/github-script@v6
with:
script: |
const fs = require('fs');
const issue = context.payload.issue;
const jsonContent = JSON.stringify(issue, null, 2);
if (!fs.existsSync('_data')){
fs.mkdirSync('_data');
}
fs.writeFileSync('_data/banner.json', jsonContent);
console.log('Issue converted to JSON and written to _data/banner.json');
console.log('Content:', jsonContent);
# This tells the action which GitHub Issue Form template file to use
issue-template: "banner.yaml"
# This controls which property we use to key the file name hash off of (values should be unique in your data set)
hash-property-name: "url"

- name: List _data directory
run: ls -l _data
# - name: List _data directory
# run: ls -l _data

- name: Update the existing files
run: python scripts/banner.py
Expand All @@ -91,4 +85,4 @@ jobs:
git checkout -b staging
git add banner.json
git commit -m "Updating banner for #${{ env.IssueNumber }}"
git push --set-upstream origin staging
git push
15 changes: 0 additions & 15 deletions scripts/banner.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
# import json
# import os
#
# # Get the output file
# if not os.path.exists("_data"):
# os.makedirs("_data")
#
# files = os.listdir("_data")
# print(files)
# # Read the output file
# new_banner = json.load(open(f"_data/{files[0]}"))
# print(new_banner)
#
# # Update the existing file
# json.dump(new_banner, open("banner.json", "w"))
import json
import os

Expand Down

0 comments on commit 7e30ebd

Please sign in to comment.