Skip to content

Commit

Permalink
Thefourcraft patch 1 (#7)
Browse files Browse the repository at this point in the history
* Rename hello-world.md to intro.md

* update pack and fix outdated

* temp remove yarn

* update github things

* create workflows for testing auto pr for pages
  • Loading branch information
thefourcraft authored Sep 11, 2023
1 parent af6628c commit af97e26
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/ISSUE_TEMPLATE/new_docusaurus_page.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: New Docusaurus Page
about: Create a new Docusaurus page.
labels: new-page
---

## Page Title

Enter the title of the page.

## Page Description

Enter the description for the page.

## Sidebar Position

Enter the sidebar position for the page.

## Page Content

Enter the content of the page.
48 changes: 48 additions & 0 deletions .github/workflows/create_docusaurus_page.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Create Docusaurus Page from Issue

on:
issues:
types: [opened, labeled]

jobs:
create-docusaurus-page:
runs-on: ubuntu-latest
if: github.event.label.name == 'new-page'
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Create Branch
run: |
ISSUE_NUMBER=${{ github.event.issue.number }}
BRANCH_NAME="new-page-${ISSUE_NUMBER}"
git checkout -b $BRANCH_NAME
git push origin $BRANCH_NAME
- name: Create Docusaurus File
run: |
ISSUE_NUMBER=${{ github.event.issue.number }}
ISSUE_BODY="${{ github.event.issue.body }}"
TITLE=$(echo "$ISSUE_BODY" | grep -oP '## Page Title\s*\K.*')
DESCRIPTION=$(echo "$ISSUE_BODY" | grep -oP '## Page Description\s*\K.*')
SIDEBAR_POSITION=$(echo "$ISSUE_BODY" | grep -oP '## Sidebar Position\s*\K.*')
CONTENT=$(echo "$ISSUE_BODY" | sed -n '/## Page Content/,//p' | tail -n +2)
FILENAME="./docs/new-page-${ISSUE_NUMBER}.md"
echo "---" > $FILENAME
echo "title: $TITLE" >> $FILENAME
echo "description: $DESCRIPTION" >> $FILENAME
echo "sidebar_position: $SIDEBAR_POSITION" >> $FILENAME
echo "---" >> $FILENAME
echo "$CONTENT" >> $FILENAME
git add $FILENAME
git commit -m "Create new Docusaurus page from issue $ISSUE_NUMBER"
git push origin $BRANCH_NAME
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
title: "New Docusaurus Page from Issue ${{ github.event.issue.number }}"
branch: "new-page-${{ github.event.issue.number }}"
base: "main"
22 changes: 22 additions & 0 deletions .github/workflows/stale-bot..yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: 'Automatically close stale issues and PRs'
on:
workflow_dispatch:
schedule:
- cron: '0 */6 * * *'
#Run every 6 hours

jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v7
with:
stale-issue-message: 'We are clearing up our old issues and your ticket has been open for 3 months with no activity. Remove stale label or comment or this will be closed in 2 days.'
close-issue-message: 'This issue was closed because it has been stalled for 30 days with no activity.'
days-before-stale: 90
days-before-close: 30
days-before-pr-stale: 999999999
days-before-pr-close: 1
exempt-issue-labels: 'News,Medium,High,discussion,bug,doc,feature-request'
exempt-issue-assignees: 'thefourcraft'
operations-per-run: 200
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Remove Yarn
.yarn

0 comments on commit af97e26

Please sign in to comment.