-
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.
- Loading branch information
1 parent
d77e43c
commit 29a047a
Showing
1 changed file
with
102 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,102 @@ | ||
name: Repo Generator | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
Replace_Links_In_Markdown: | ||
description: 'Update all links' | ||
type: boolean | ||
required: false | ||
Update_Code_Of_Conduct_EMAIL: | ||
description: 'Update Code Of Conduct Email' | ||
type: boolean | ||
required: false | ||
Generate_Table_Of_Contents: | ||
description: 'Generate Table Of Contents' | ||
type: boolean | ||
required: false | ||
Generate_Metrics_File: | ||
description: 'Generate Metrics Image File' | ||
type: boolean | ||
required: false | ||
|
||
|
||
jobs: | ||
test_job: | ||
name: Test | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
### Update links in README file | ||
- name: Updating links in README content | ||
if: ${{ github.event.inputs.Replace_Links_In_Markdown == 'true' }} | ||
run: | | ||
sudo apt-get install python3 python3-pip | ||
pip3 install html2image | ||
python3 .github/py_repo_tools/replace_repo_links.py | ||
|
||
### Metric Images | ||
|
||
- name: Generating Metrics Image | ||
if: ${{ github.event.inputs.Generate_Metrics_File == 'true' }} | ||
uses: lowlighter/[email protected] | ||
with: | ||
filename: stargazers-metrics.svg | ||
filepath: /.github/ | ||
plugin_stargazers_charts_type: chartist | ||
token: ${{ secrets.METRICS_TOKEN }} | ||
|
||
|
||
|
||
base: "" | ||
|
||
config_octicon: yes | ||
|
||
plugin_stargazers: yes | ||
plugin_contributors: yes | ||
|
||
|
||
## - name: Move Metrics Image | ||
|
||
# if: ${{ github.event.inputs.Generate_Metrics_File == 'true' }} | ||
|
||
# run: | | ||
# git mv -f ~/work/${{ github.event.repository.name }}/${{ github.event.repository.name }}/metrics.plugin.stargazers.svg ~/work/${{ github.event.repository.name }}/${{ github.event.repository.name }}/.github | ||
|
||
|
||
### Table Of Contents | ||
- name: Generating Table Of Contents | ||
if: ${{ github.event.inputs.Generate_Table_Of_Contents == 'true' }} | ||
run: | # To optimize images simply run this | ||
git push --delete origin v1.0.0 | ||
### Replace COC E-mail | ||
- name: Updating Code Of Conduct E-Mail | ||
if: ${{ github.event.inputs.Update_Code_Of_Conduct_EMAIL == 'true' }} | ||
run: | | ||
sudo apt-get install python3 python3-pip | ||
pip3 install bleach | ||
python3 .github/py_repo_tools/generate_index_file.py | ||
### Commit updates (if any) | ||
- name: Commiting updates | ||
if: ${{ github.event.inputs.Update_Code_Of_Conduct_EMAIL == 'true' }} | ||
run: | | ||
git config --global user.name "github-actions[bot]" | ||
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
git add -A | ||
git commit -m "Updated Code Of Conduct Email" | ||
git push | ||
- name: Commiting updates | ||
if: ${{ github.event.inputs.Replace_Links_In_Markdown == 'true' }} | ||
run: | | ||
git config --global user.name "github-actions[bot]" | ||
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
git add -A | ||
git commit -m "Updated README links" | ||
git push | ||
|