-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 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
1 parent
af6628c
commit af97e26
Showing
4 changed files
with
94 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,3 +18,6 @@ | |
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# Remove Yarn | ||
.yarn |