Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
KOLANICH committed Oct 19, 2023
0 parents commit 47d2d53
Show file tree
Hide file tree
Showing 28 changed files with 2,258 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .ci/pythonPackagesToInstallFromGit.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
https://github.com/Ousret/charset_normalizer
https://github.com/psf/requests
11 changes: 11 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
root = true

[*]
charset = utf-8
indent_style = tab
indent_size = 4
insert_final_newline = true

[*.{yml,yaml}]
indent_style = space
indent_size = 2
1 change: 1 addition & 0 deletions .github/.templateMarker
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
KOLANICH/python_project_boilerplate.py
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2
updates:
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "daily"
allow:
- dependency-type: "all"
16 changes: 16 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: CI
on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: typical python workflow
uses: KOLANICH-GHActions/typical-python-workflow@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
should_isolate_testing: false
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
__pycache__
*.pyc
*.pyo
/*.egg-info
*.srctrlbm
*.srctrldb
build
dist
.eggs
monkeytype.sqlite3
/.ipynb_checkpoints
1 change: 1 addition & 0 deletions Code_Of_Conduct.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
No codes of conduct!
4 changes: 4 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
include UNLICENSE
include *.md
include tests
include .editorconfig
21 changes: 21 additions & 0 deletions ReadMe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
miniGHAPI.py [![Unlicensed work](https://raw.githubusercontent.com/unlicense/unlicense.org/master/static/favicon.png)](https://unlicense.org/)
============
[![Libraries.io Status](https://img.shields.io/librariesio/github/KOLANICH-libs/miniGHAPI.py.svg)](https://libraries.io/github/KOLANICH-libs/miniGHAPI.py)
[![Code style: antiflash](https://img.shields.io/badge/code%20style-antiflash-FFF.svg)](https://codeberg.org/KOLANICH-tools/antiflash.py)

A small library for interacting with GitHub intended to be used in GitHub Actions implemented in python.

Most of the actions must be authenticated. You need different tokens depending on your use case:

* `env["INPUT"]["GITHUB_TOKEN"]` to work with issues or send annotations
* `env["ACTIONS"]["RUNTIME_TOKEN"]` to work with undocumented API, such as creating artifacts, working with cache or sending SARIF analytics

Actions retrieving collections populate properties. Use `get*` methods to fetch them and populate.

The lib also contains some bindings to undocumented API, allowing you to upload files for workflows.


Dependencies
------------

* [`requests`](https://github.com/psf/requests)[![PyPi Status](https://img.shields.io/pypi/v/requests.svg)](https://pypi.org/pypi/requests)[![GitHub Actions](https://github.com/psf/requests/workflows/run-tests/badge.svg)](https://github.com/psf/requests/actions/)[![Libraries.io Status](https://img.shields.io/librariesio/github/psf/requests.svg)](https://libraries.io/github/psf/requests)![License](https://img.shields.io/github/license/psf/requests.svg) or [`httpx`](https://github.com/encode/httpx)[![PyPi Status](https://img.shields.io/pypi/v/httpx.svg)](https://pypi.org/pypi/httpx)[![GitHub Actions](https://github.com/encode/httpx/workflows/Test%20Suite/badge.svg)](https://github.com/encode/httpx/actions/)[![Libraries.io Status](https://img.shields.io/librariesio/github/encode/httpx.svg)](https://libraries.io/github/encode/httpx)
24 changes: 24 additions & 0 deletions UNLICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.

In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

For more information, please refer to <https://unlicense.org/>
12 changes: 12 additions & 0 deletions drafts/ToDo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
pipelines

_apis/distributedtask/pools/<int>/messages?sessionId=
_apis/pipelines/<int>/runs/<int>/signedlogcontent/<int>
_apis/pipelines/<int>/runs/<int>/signedartifactscontent
_apis/distributedtask/pools/<int>/jobrequests/1?lockToken=00000000-0000-0000-0000-000000000000
_apis/connectionData?connectOptions=0&lastChangeId=<int>&lastChangeId64=<int>
_apis/distributedtask/pools/1/messages?sessionId=<guid>&lastMessageId=1


https://uploads.github.com
https://codeload.github.com
128 changes: 128 additions & 0 deletions drafts/download_cache.har
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
{
"log": {
"version": "1.2",
"creator": {
"name": "mitmproxy har_dump",
"version": "0.1",
"comment": "mitmproxy version mitmproxy 8.0.0.dev"
},
"entries": [{
"startedDateTime": "2021-10-11T16:56:52.735953+00:00",
"time": 259,
"request": {
"method": "GET",
"url": "https://artifactcache.actions.githubusercontent.com/E4URfvsVX19r9dHrZIEEg4Trg62KRQ4tSS79OFlTb4URXLbOOm/_apis/artifactcache/cache?keys=test_key&version=0971361fda91b2570d0fec00f23414b690ef4c6998b5cda8ade9b886b6708e86",
"httpVersion": "HTTP/1.1",
"cookies": [],
"headers": [{
"name": "accept",
"value": "application/json;api-version=6.0-preview.1"
},
{
"name": "user-agent",
"value": "actions/cache"
},
{
"name": "Authorization",
"value": "Bearer <super secret value>"
},
{
"name": "Host",
"value": "artifactcache.actions.githubusercontent.com"
},
{
"name": "Connection",
"value": "close"
}
],
"queryString": [{
"name": "keys",
"value": "test_key"
},
{
"name": "version",
"value": "0971361fda91b2570d0fec00f23414b690ef4c6998b5cda8ade9b886b6708e86"
}
],
"headersSize": 1884,
"bodySize": 0
},
"response": {
"status": 204,
"statusText": "No Content",
"httpVersion": "HTTP/1.1",
"cookies": [],
"headers": [{
"name": "Cache-Control",
"value": "no-store,no-cache"
},
{
"name": "Pragma",
"value": "no-cache"
},
{
"name": "Strict-Transport-Security",
"value": "max-age=2592000"
},
{
"name": "X-TFS-ProcessId",
"value": "2fbe4925-c5d7-4d0d-b023-c5077e195ed6"
},
{
"name": "ActivityId",
"value": "<guid2>"
},
{
"name": "X-TFS-Session",
"value": "<guid2>"
},
{
"name": "X-VSS-E2EID",
"value": "<guid2>"
},
{
"name": "X-VSS-SenderDeploymentId",
"value": "<guid1>"
},
{
"name": "X-FRAME-OPTIONS",
"value": "SAMEORIGIN"
},
{
"name": "X-Cache",
"value": "CONFIG_NOCACHE"
},
{
"name": "X-MSEdge-Ref",
"value": "Ref A: 2BFBFB09DE2D4DB2BD4948C4C189778B Ref B: DM2EDGE0716 Ref C: 2021-10-11T16:56:52Z"
},
{
"name": "Date",
"value": "Mon, 11 Oct 2021 16:56:52 GMT"
},
{
"name": "Connection",
"value": "close"
}
],
"content": {
"size": 0,
"compression": 0,
"mimeType": "",
"text": ""
},
"redirectURL": "",
"headersSize": 692,
"bodySize": 0
},
"cache": {},
"timings": {
"send": 6,
"receive": 4,
"wait": 228,
"connect": 7,
"ssl": 14
}
}]
}
}
Loading

0 comments on commit 47d2d53

Please sign in to comment.