From d4f7e9760f0670b47cb9a3fd71e270839c2eaecf Mon Sep 17 00:00:00 2001 From: Binita Date: Wed, 10 Jul 2024 09:45:49 -0500 Subject: [PATCH] delete staging before creating new branch in yaml file --- .github/workflows/banner.yaml | 84 +---------------------------------- 1 file changed, 1 insertion(+), 83 deletions(-) diff --git a/.github/workflows/banner.yaml b/.github/workflows/banner.yaml index 2e6eed2..a740bf5 100644 --- a/.github/workflows/banner.yaml +++ b/.github/workflows/banner.yaml @@ -1,85 +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 "action@github.com" -# git config --local user.name "GitHub Action" -# -# - name: Checkout or Create Staging Branch -# run: | -# git fetch -# if git show-ref --verify --quiet refs/remotes/origin/staging; then -# git branch -D staging -# git push origin --delete staging -# fi -# git checkout -b staging -# git push --set-upstream origin staging -# -# -# - name: Commit files -# id: commit-changes -# run: | -# git add banner.json -# git diff-index --quiet HEAD || echo "changes_detected=true" >> $GITHUB_ENV -# git commit -m "Updating banner for #${{ github.event.issue.number }}" || echo "No changes to commit" -# -# - name: Push changes -# if: env.changes_detected == 'true' -# run: | -# git pull --rebase --strategy-option=theirs origin staging -# git push --set-upstream origin staging -# -# - name: Create pull request to main -# if: env.changes_detected == 'true' -# run: | -# echo -e "Scheduled banner update ${{ github.event.issue.number }}. 🔔 @slesaad\nAutomatically created by Github action" > msg -# gh pr create -H staging -B main --title 'Update banner for #${{ github.event.issue.number }}' --body-file msg --reviewer slesaad -# env: -# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -# - name: Update banner on: @@ -88,7 +6,7 @@ on: - opened - edited - reopened - - labeled +# - labeled jobs: update_files: