Skip to content

Commit

Permalink
fix error
Browse files Browse the repository at this point in the history
  • Loading branch information
binni979 committed Jul 9, 2024
1 parent f5ebdb4 commit 2dcffac
Showing 1 changed file with 2 additions and 82 deletions.
84 changes: 2 additions & 82 deletions .github/workflows/banner.yaml
Original file line number Diff line number Diff line change
@@ -1,82 +1,3 @@
#name: Update banner
#
#on:
# issues:
# types:
# - opened
# - edited
# - reopened
# - labeled
#
#jobs:
# update_files:
# runs-on: ubuntu-latest
#
# permissions:
# contents: write
# pull-requests: write
#
# name: Convert New Issue to GHG Dashboard Dynamic Data
# if: contains(github.event.issue.labels.*.name, 'banner')
# steps:
# - name: Checkout
# uses: actions/checkout@v3
#
# - 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/issue.json', jsonContent);
# console.log('Issue converted to JSON and written to _data/issue.json');
# console.log('Content:', jsonContent);
#
# - name: List _data directory
# run: ls -l _data
#
# - name: Update the existing files
# run: python scripts/banner.py
#
# - name: Configure Git
# run: |
# git config --local user.email "[email protected]"
# git config --local user.name "GitHub Action"
#
# - name: Checkout or Create Staging Branch
# run: |
# git fetch
# if git show-ref --verify --quiet refs/heads/staging; then
# git checkout staging
# git pull origin staging
# else
# git checkout -b staging
# fi
#
# - name: Commit files
# run: |
# git add banner.json
# git commit -m "Updating banner for #${{ github.event.issue.number }}"
#
# - name: Push changes
# run: |
# git pull --rebase --strategy-option=theirs origin staging
# git push --set-upstream origin staging
#
# - name: Create Pull Request
# uses: peter-evans/create-pull-request@v5
# with:
# base: main
# head: staging
# title: "Update banner for #${{ github.event.issue.number }}"
# body: "This pull request updates the banner based on the issue #${{ github.event.issue.number }}."
# reviewers: slesaad


name: Update banner

on:
Expand All @@ -95,8 +16,8 @@ jobs:
contents: write
pull-requests: write

name: Convert New Issue to GHG Dashboard Dynamic Data
if: contains(github.event.issue.labels.*.name, 'banner')

steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -108,7 +29,7 @@ jobs:
const fs = require('fs');
const issue = context.payload.issue;
const jsonContent = JSON.stringify(issue, null, 2);
if (!fs.exists('_data')){
if (!fs.existsSync('_data')){
fs.mkdirSync('_data');
}
fs.writeFileSync('_data/issue.json', jsonContent);
Expand Down Expand Up @@ -149,7 +70,6 @@ jobs:
# - name: Create Pull Request
# uses: peter-evans/create-pull-request@v5
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
# base: main
# head: staging
# title: "Update banner for #${{ github.event.issue.number }}"
Expand Down

0 comments on commit 2dcffac

Please sign in to comment.