Skip to content

Instantly share code, notes, and snippets.

View ingvaldlorentzen's full-sized avatar
💸

Ingvald Lorentzen ingvaldlorentzen

💸
View GitHub Profile
@ingvaldlorentzen
ingvaldlorentzen / update_packagejson.py
Last active February 11, 2022 10:19
Get Outdated Dependencies package.json
import json
import sys
import requests
# Hosted on: https://gist.github.com/ingvaldlorentzen/616aeb8c6a44522fa291c4fd6df3c312
# Raw: https://gist.githubusercontent.com/ingvaldlorentzen/616aeb8c6a44522fa291c4fd6df3c312/raw/update_packagejson.py
with open('npm_output.json', 'r') as file:
outdated_packages = json.load(file)
@ingvaldlorentzen
ingvaldlorentzen / create_mr.py
Last active February 11, 2022 10:49
Create Dependency Updates MR
import json
import os
from itertools import chain
from gitlab import Gitlab, GitlabGetError
from mdutils import MdUtils
# Hosted on: https://gist.github.com/ingvaldlorentzen/92796c98fa6a26a592f94200eb161cf8
# Raw: https://gist.githubusercontent.com/ingvaldlorentzen/92796c98fa6a26a592f94200eb161cf8/raw/create_mr.py
@ingvaldlorentzen
ingvaldlorentzen / update_pyproject.py
Last active February 11, 2022 10:18
Get Outdated Dependencies pyproject.toml
import json
import os
import subprocess
import requests
from tomlkit.toml_file import TOMLFile
# Hosted on: https://gist.github.com/ingvaldlorentzen/d58fe2843069cee9c524d28c12c6eb13
# Raw: https://gist.githubusercontent.com/ingvaldlorentzen/d58fe2843069cee9c524d28c12c6eb13/raw/update_pyproject.py
@ingvaldlorentzen
ingvaldlorentzen / delete_artifacts.py
Created January 3, 2022 15:10
GitLab Delete Pipeline Artifacts
import os
from gitlab import Gitlab
gitlab = Gitlab(os.environ['CI_SERVER_URL'], private_token=os.environ['GITLAB_API_TOKEN'])
project = gitlab.projects.get(os.environ['CI_PROJECT_PATH'])
pipeline = project.pipelines.get(os.environ['CI_PIPELINE_ID'])