-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ci): create workflow for README\s
- Loading branch information
1 parent
0b89a70
commit 0eb4554
Showing
3 changed files
with
47 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,24 @@ | ||
name: Build readme's | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '20' | ||
- name: Run tests | ||
run: node fix_readmes.js |
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,11 @@ | ||
[![wakatime](https://wakatime.com/badge/github/NeonGamerBot-QK/apcsa.svg)](https://wakatime.com/badge/github/NeonGamerBot-QK/apcsa) | ||
![Java](https://img.shields.io/badge/java-%23ED8B00.svg?style=for-the-badge&logo=openjdk&logoColor=white) | ||
|
||
## APCSA | ||
|
||
This repository contains all my files for my APCS A class. | ||
|
||
### Table of contents: | ||
{contents} | ||
|
||
|
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,12 @@ | ||
const fs = require('fs') | ||
|
||
const filesWhichAreDirs = fs.readdirSync('./').filter(file => fs.lstatSync(file).isDirectory()) | ||
|
||
const projectsInMd = filesWhichAreDirs.filter(dir => { | ||
if (['.github', 'target'].includes(dir)) return false; | ||
return true; | ||
}).map(dir => `- [**${dir}**](./${dir}/README.md)`).join('\n') | ||
|
||
fs.writeFileSync('./README.md', fs.readFileSync('./README.template').toString().replace('{content}', projectsInMd)) | ||
|
||
require('child_process').execSync('git add . && git commit -m "ci(zeon): Update README.md" && git push') |