GitHub Activity Demo Script
This script aims to prove why you should not be too quick at judging people by their GitHub activity stats.
The script will turn your contributions graph from this:
Into this:
In 20-30 seconds.
Use for demo purposes only!
To execute just run the following commaind inside a demo repository:
- First download the script
- After that run the script
- Finally, push your changes to GitHub
Get started
export ACTIVITY_BR=main ; export MAX_PAST_DAYS=365 ; export COMMIT_NB= ; export COMMIT_MAX=7 ; \
curl -sL https://raw.githubusercontent.com/ccdd12/github-activity-bash-script/main/activity.sh \
| bash ;
Install
bash -c 'UPDATE_BIN="${HOME}/.local/bin" ; \
curl -sL https://raw.githubusercontent.com/ccdd12/github-activity-bash-script/main/activity.sh \
--output ${UPDATE_BIN}/${gh-gen-activity.sh} && \
${UPDATE_BIN}/${gh-gen-activity.sh} --update && \
${UPDATE_BIN}/${gh-gen-activity.sh} --interactive --branch=main --past=365 --commit-max=10 '
Documentation
env | description | type | default value | command line arguments | |
---|---|---|---|---|---|
ACTIVITY_BR |
working git branch | string |
main |
--branch | --br | -b {value} |
--branch={value} |
MAX_PAST_DAYS |
number of past days | integer |
365 |
--past | -p {value} |
--past={value} |
COMMIT_NB |
exactly git commit number each past day. | integer |
∅ | --commit-nb | --nb | -n {value} |
--commit-nb={value} | --nb={value} |
COMMIT_MAX |
randomly git commit number each past day between [1…max]. used only if COMMIT_NB is empty.if both COMMIT_MAX and COMMIT_NB empty, randomly commit number each past day between [1..7] |
integer |
7 |
--commit-max | --max | -m {value} |
--commit-max={value} | --nb={value} |
GITHUB_AUTHOR |
owner of github repo to update from | string |
ccdd12 |
--gh-author {value} |
--gh-author={value} |
REPONAME |
github repo to update from | string |
github-activity-bash-script |
--reponame {value} |
--reponame={value} |
ASSET_FILENAME |
release asset filename to download | string |
gh-gen-activity.sh |
--asset-fname {value} |
--asset-fname={value} |
UPDATE_BIN |
update and install to given path | string |
${HOME}/.local/bin |
--update {value} |
--update={value} |
SELECTED_UPDATE_FUN |
bash function to run when update requested. this foes not launch update action |
string |
update_ghrelease | update_ghrepo | update_ghpage |
--update-fun {value} |
--update-fun={value} |
∅ | interactive mode, ask user to create repo on github and push to it automatically. does not work in pipe (ex. curl -sL https://...../activity.sh | bash ) |
∅ | --interactive | -i |
Introduction to Bash Scripting
In case that you are interested in learning more about Bash Scripting, make sure to checkout this open-source eBook:
Introduction to Bash Scripting
Blog Post
Here is why you should not be too quick at judging people by their GitHub activity stats