Skip to content

Instantly share code, notes, and snippets.

View legendof-selda's full-sized avatar

Stalin Sabu Thomas legendof-selda

View GitHub Profile
@legendof-selda
legendof-selda / mkdocs_azure_wiki_sync.yml
Last active June 17, 2023 04:35
GitHub action which syncs mkdocs to azure devops wiki.
name: Publish docs via GitHub Pages
# syncs your mkdocs markdown files with azure devops wiki.
# NOTE: this doesn't work with automated markdown files which maybe generated in your case
# this also doesn't deal with ordering
on:
push:
branches:
- develop
workflow_dispatch:
@legendof-selda
legendof-selda / _version.py
Last active August 17, 2021 14:30
A quick version tagging script which uses git. Simply in cli run python _version.py {the method name}
import os
import subprocess
import sys
from typing import Union
BRANCH_TAG_MAP = {
"develop": "nightly",
"staging": "alpha",
"release": "alpha",
"master": None,
@legendof-selda
legendof-selda / stale_branch_cleanup.py
Last active July 27, 2021 09:49
A python script to cleanup stale or old branches in git using last commit date and required flag
import pandas as pd
import subprocess
import os
env = os.environ.copy()
STALE_PERIOD = 10
REQUIRED_BRANCHES = ['master', 'staging', 'develop']
branches = subprocess.run('git branch -r' , capture_output=True, env=env, shell=True)
branches = branches.stdout.decode('utf-8').strip().split('\n')[1:]