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
modified_dirs='["a", "a/b", "b/c/d", "c/d/e.txt"]' | |
modified_dirs=$(echo $modified_files | jq -r '[ .[] | split("/") | .[0] ] | unique') |
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
table="..." | |
for pk in $(aws dynamodb scan --table-name ${table} | jq -r '.Items | .[].pk.S'); do | |
aws_cli dynamodb delete-item --table-name "${table}" --key '{"pk":{"S":"'$pk'"}}' & | |
sleep 0.01 | |
echo "Deleted: $table / $pk" | |
done |
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
python -c "import http.client; \ | |
c = http.client.HTTPConnection('localhost:8080'); \ | |
r = c.request('GET', '/health'); \ | |
r = c.getresponse(); \ | |
assert r.status == 200, (r.status, r.reason)" | |
python -c 'import httpx; r = httpx.get("http://localhost:8080/health"); r.raise_for_status()' |
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
# not sure if it's best way. Maybe better just: | |
# - name: Install Python 3.8 | |
# uses: actions/setup-python@v4 | |
# with: | |
# python-version: 3.8 | |
# cache: poetry | |
- name: Configure docker | |
uses: docker/login-action@v2 |
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
# Usage: | |
# $ export KEY=kek OTHER_KEYS="aa bb" OTHER_VALS="AA BB" | |
# $ echo "12 34" | python .github/workflows/helpers/construct_json_list_of_values.py | |
# [{"kek": "12", "aa": "AA", "bb": "BB"}, {"kek": "34", "aa": "AA", "bb": "BB"}] | |
import json | |
import os | |
import sys | |
KEY = os.environ["KEY"] |
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
... | |
- uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} # checkout pull request HEAD commit instead of merge commit | |
fetch-depth: 0 # fetch all history for all branches and tags | |
- name: Set env variables | |
id: setup-vars | |
run: | |
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
FILE_PATH=path/to/config/file.yaml | |
LINE_MARK="tag: " | |
line_number=$(awk "/$LINE_MARK/ {print FNR}" $FILE_PATH) | |
test $line_number # TODO: better error reporting | |
git log --oneline --decorate --pretty=format:"%cs [%h] by %aN%n" -u -L ${line_number},${line_number}:$FILE_PATH \ | |
| grep -v "diff --git\|---\|+++\|@@\|- \|^$" |
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
[flake8] | |
max-line-length = 88 | |
extend-ignore = \ | |
E203, \ # whitespace before ':' | |
F841, \ # local variable name is assigned to but never used | |
E266, \ # too many leading '#' for block comment | |
per-file-ignores = | |
*/__init__.py: F401 |
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
name: Transform input json, similar to jq | |
inputs: | |
input_json: {type: string, required: true} | |
transform: {type: string, required: true} | |
outputs: | |
result: | |
value: ${{ steps.parse.outputs.result }} |
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
name: Setup env variables | |
inputs: | |
vars_json: {type: string, default: "{}"} | |
# TODO: add argument "by_workflow_call: bool" to skip some steps | |
# env vars to override: | |
PAYLOAD: {type: string, default: ""} | |
TRAIN_IMAGE_TAG: {type: string, default: ""} | |
outputs: |