forked from anmol098/waka-readme-stats
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master' into mm
Signed-off-by: ashing <[email protected]>
- Loading branch information
Showing
28 changed files
with
1,757 additions
and
3,282 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 |
---|---|---|
@@ -1,15 +1,26 @@ | ||
INPUT_WAKATIME_API_KEY="" | ||
INPUT_SHOW_TIMEZONE="True" | ||
INPUT_SHOW_PROJECTS="False" | ||
INPUT_SHOW_EDITORS="False" | ||
INPUT_SHOW_OS="False" | ||
INPUT_SHOW_LANGUAGE="False" | ||
INPUT_GH_TOKEN="" | ||
INPUT_SYMBOL_VERSION="1" | ||
INPUT_SHOW_LINES_OF_CODE="False" | ||
INPUT_SHOW_LOC_CHART="False" | ||
INPUT_SHOW_PROFILE_VIEWS="False" | ||
INPUT_SHOW_TOTAL_CODE_TIME="True" | ||
INPUT_SHOW_SHORT_INFO="False" | ||
INPUT_SHOW_COMMIT="False" | ||
INPUT_SHOW_DAYS_OF_WEEK="True" | ||
INPUT_WAKATIME_API_KEY=YOUR_WAKATIME_API_KEY | ||
INPUT_GH_TOKEN=YOUR_GITHUB_TOKEN_KEY | ||
INPUT_PUSH_BRANCH_NAME=main | ||
INPUT_PULL_BRANCH_NAME=main | ||
INPUT_SECTION_NAME=waka | ||
INPUT_SHOW_TIMEZONE=True | ||
INPUT_SHOW_PROJECTS=True | ||
INPUT_SHOW_EDITORS=True | ||
INPUT_SHOW_OS=True | ||
INPUT_SHOW_LANGUAGE=True | ||
INPUT_SYMBOL_VERSION=1 | ||
INPUT_SHOW_LINES_OF_CODE=True | ||
INPUT_SHOW_LOC_CHART=True | ||
INPUT_SHOW_PROFILE_VIEWS=True | ||
INPUT_SHOW_TOTAL_CODE_TIME=True | ||
INPUT_SHOW_SHORT_INFO=True | ||
INPUT_SHOW_COMMIT=True | ||
INPUT_SHOW_DAYS_OF_WEEK=True | ||
INPUT_SHOW_LANGUAGE_PER_REPO=True | ||
INPUT_SHOW_UPDATED_DATE=True | ||
INPUT_UPDATED_DATE_FORMAT=%d/%m/%Y %H:%M:%S | ||
INPUT_COMMIT_BY_ME=True | ||
INPUT_COMMIT_MESSAGE=Updated with Dev Metrics | ||
INPUT_COMMIT_SINGLE=True | ||
INPUT_DEBUG_LOGGING=True | ||
DEBUG_RUN=True |
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,17 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "docker" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
open-pull-requests-limit: 99 | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
open-pull-requests-limit: 99 | ||
- package-ecosystem: "pip" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
open-pull-requests-limit: 99 |
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,46 @@ | ||
name: PUBLISH_IMAGE | ||
|
||
on: | ||
push: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} | ||
|
||
jobs: | ||
publish-server-image: | ||
name: Publish 'waka-readme-stats' image | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout 🛎️ | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Docker Buildx 🐋 | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Log in to the container registry 🚪 | ||
uses: docker/login-action@v2 | ||
with: | ||
username: wakareadmestats | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker 🏋️ | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: wakareadmestats/waka-readme-stats | ||
tags: | | ||
type=ref,event=branch | ||
type=ref,event=pr | ||
type=semver,pattern={{version}} | ||
type=semver,pattern={{major}}.{{minor}} | ||
- name: Build and push Docker image 🏗️ | ||
uses: docker/build-push-action@v4 | ||
with: | ||
push: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/releases') }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max |
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,84 @@ | ||
name: CI | ||
|
||
on: | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
ci: | ||
name: Run Test and Review PR | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout 🛎️ | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Python 3.11 🐍 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.11 | ||
cache: 'pip' | ||
|
||
- name: Install Dependencies 📥 | ||
run: pip install -r requirements.txt | ||
|
||
- name: Create Assets Folder 📥 | ||
run: mkdir assets | ||
|
||
- name: Create Previous Comments 🫣 | ||
uses: int128/hide-comment-action@v1 | ||
with: | ||
starts-with: "README stats current output:" | ||
|
||
- name: Run Action Preview on Current Code 🧪 | ||
id: make-stats | ||
env: | ||
INPUT_GH_TOKEN: ${{ secrets.INPUT_GITHUB_TOKEN }} | ||
INPUT_WAKATIME_API_KEY: ${{ secrets.WAKATIME_API_KEY }} | ||
INPUT_SHOW_TIMEZONE: True | ||
INPUT_SHOW_PROJECTS: True | ||
INPUT_SHOW_EDITORS: True | ||
INPUT_SHOW_OS: True | ||
INPUT_SHOW_LANGUAGE: True | ||
INPUT_SYMBOL_VERSION: 1 | ||
INPUT_SHOW_LINES_OF_CODE: True | ||
INPUT_SHOW_LOC_CHART: True | ||
INPUT_SHOW_PROFILE_VIEWS: True | ||
INPUT_SHOW_TOTAL_CODE_TIME: True | ||
INPUT_SHOW_SHORT_INFO: True | ||
INPUT_SHOW_COMMIT: True | ||
INPUT_SHOW_DAYS_OF_WEEK: True | ||
INPUT_SHOW_LANGUAGE_PER_REPO: True | ||
INPUT_SHOW_UPDATED_DATE: True | ||
INPUT_COMMIT_BY_ME: True | ||
INPUT_DEBUG_LOGGING: True # Not for prod | ||
DEBUG_RUN: True # Not for prod | ||
run: python3 sources/main.py | ||
|
||
- name: Save Branch Name Without Slashes 📛 | ||
if: ${{ github.ref != 'refs/heads/master' }} | ||
env: | ||
BRANCH_NAME: ${{ github.head_ref || github.ref_name }} | ||
run: | | ||
BRANCH_NAME=${{ env.BRANCH_NAME }} | ||
BRANCH_NAME=${BRANCH_NAME////_} | ||
echo BRANCH_NAME=${BRANCH_NAME} >> $GITHUB_ENV | ||
- name: Upload Artifact 📦 | ||
uses: actions/upload-artifact@v3 | ||
if: ${{ github.ref != 'refs/heads/master' }} | ||
with: | ||
name: ${{ format('github-pages-for-branch-{0}', env.BRANCH_NAME) }} | ||
path: assets | ||
|
||
- name: Create Comment 💬 | ||
uses: jungwinter/comment@v1 | ||
with: | ||
type: create | ||
body: ${{ steps.make-stats.outputs.README_CONTENT }} | ||
issue_number: ${{ github.event.number }} | ||
token: ${{ secrets.GITHUB_TOKEN }} |
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,56 @@ | ||
name: CodeQL | ||
|
||
on: | ||
push: | ||
branches: master | ||
pull_request: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '30 13 * * 6' | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} | ||
|
||
jobs: | ||
analyze: | ||
name: Analyze | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
language: [ 'python' ] | ||
|
||
steps: | ||
- name: Checkout 🛎️ | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Python 3.11 🐍 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.11 | ||
cache: 'pip' | ||
|
||
- name: Install dependencies 📥 | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
echo "CODEQL_PYTHON=$(which python)" >> $GITHUB_ENV | ||
- name: Initialize CodeQL 🧑💻 | ||
uses: github/codeql-action/init@v2 | ||
with: | ||
languages: ${{ matrix.language }} | ||
queries: security-and-quality | ||
setup-python-dependencies: false | ||
|
||
- name: Perform CodeQL Analysis 📈 | ||
uses: github/codeql-action/analyze@v2 | ||
with: | ||
category: "/language:${{matrix.language}}" |
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: CODESTYLE | ||
|
||
on: | ||
push: | ||
|
||
jobs: | ||
lint: | ||
name: Run codestyle check | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout 🛎️ | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Python 3.11 🐍 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.11 | ||
|
||
- name: Install Dependencies 📥 | ||
run: pip install -r requirements.txt | ||
|
||
- name: Run Codestyle ✔️ | ||
run: flake8 --max-line-length=160 --exclude venv,assets . && black --line-length=160 --check --exclude='/venv/|/assets/' . |
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,19 @@ | ||
name: Dependency review | ||
on: pull_request | ||
|
||
permissions: | ||
contents: read | ||
pull-requests: write | ||
|
||
jobs: | ||
dependency-review: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository 🛎️ | ||
uses: actions/checkout@v3 | ||
|
||
- name: Dependency review 👀 | ||
uses: actions/dependency-review-action@v3 | ||
with: | ||
comment-summary-in-pr: true |
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 |
---|---|---|
@@ -1,6 +1,18 @@ | ||
# Environment files: | ||
*.env | ||
*.png | ||
node_modules/ | ||
|
||
# Generated graph images: | ||
assets/ | ||
|
||
# Cloned repo path: | ||
repo/ | ||
|
||
# Library roots: | ||
venv/ | ||
|
||
# Python caches: | ||
__pycache__/ | ||
|
||
# IDE configuration files: | ||
.vscode | ||
.idea |
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
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 |
---|---|---|
@@ -1,18 +1,15 @@ | ||
FROM nikolaik/python-nodejs:python3.9-nodejs16 | ||
FROM python:3.11-alpine | ||
|
||
ADD requirements.txt /requirements.txt | ||
ADD main.py /main.py | ||
ADD loc.py /loc.py | ||
ADD make_bar_graph.py /make_bar_graph.py | ||
ADD colors.json /colors.json | ||
ADD translation.json /translation.json | ||
ENV PYTHONUNBUFFERED 1 | ||
ENV PYTHONDONTWRITEBYTECODE 1 | ||
|
||
ENV PATH "$PATH:/home/root/.npm-global/bin" | ||
RUN mkdir -p /waka-readme-stats/assets | ||
|
||
RUN python -m pip install --upgrade pip wheel setuptools | ||
RUN pip install -r requirements.txt | ||
RUN npm -g config set user root | ||
RUN npm i -g npm@latest | ||
RUN npm i -g vega vega-lite vega-cli canvas | ||
ADD requirements.txt /waka-readme-stats/requirements.txt | ||
RUN apk add --no-cache g++ jpeg-dev zlib-dev libjpeg make git && pip3 install -r /waka-readme-stats/requirements.txt | ||
|
||
ENTRYPOINT ["python", "/main.py"] | ||
RUN git config --global user.name "readme-bot" | ||
RUN git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
|
||
ADD sources/* /waka-readme-stats/ | ||
ENTRYPOINT cd /waka-readme-stats/ && python3 main.py |
Oops, something went wrong.