Merge branch 'fz-dev' into dev

This commit is contained in:
MX 2022-09-05 19:23:34 +03:00
commit a8858e38b5
No known key found for this signature in database
GPG Key ID: 6C4C311DFD4B4AB5
2 changed files with 11 additions and 3 deletions

View File

@ -195,6 +195,7 @@ bool nfc_device_load_mifare_ul_data(FlipperFormat* file, NfcDevice* dev) {
}
data->data_size = pages_total * 4;
data->data_read = pages_read * 4;
if(data->data_size > MF_UL_MAX_DUMP_SIZE || data->data_read > MF_UL_MAX_DUMP_SIZE) break;
bool pages_parsed = true;
for(uint16_t i = 0; i < pages_total; i++) {
string_printf(temp_str, "Page %d", i);

View File

@ -20,7 +20,10 @@ def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument("--event_file", help="Current GitHub event file", required=True)
parser.add_argument(
"--is_pull", help="Is it Pull Request", default=False, action="store_true"
"--type",
help="Event file type",
required=True,
choices=["pull", "tag", "other"],
)
args = parser.parse_args()
return args
@ -38,13 +41,17 @@ def get_commit_json(event):
def get_details(event, args):
data = {}
current_time = datetime.datetime.utcnow().date()
if args.is_pull:
if args.type == "pull":
commit_json = get_commit_json(event)
data["commit_comment"] = shlex.quote(commit_json[-1]["commit"]["message"])
data["commit_hash"] = commit_json[-1]["sha"]
ref = event["pull_request"]["head"]["ref"]
data["pull_id"] = event["pull_request"]["number"]
data["pull_name"] = shlex.quote(event["pull_request"]["title"])
elif args.type == "tag":
data["commit_comment"] = shlex.quote(event["head_commit"]["message"])
data["commit_hash"] = event["head_commit"]["id"]
ref = event["ref"]
else:
data["commit_comment"] = shlex.quote(event["commits"][-1]["message"])
data["commit_hash"] = event["commits"][-1]["id"]
@ -78,7 +85,7 @@ def add_envs(data, env_file, args):
add_env("BRANCH_NAME", data["branch_name"], env_file)
add_env("DIST_SUFFIX", data["suffix"], env_file)
add_env("WORKFLOW_BRANCH_OR_TAG", data["branch_name"], env_file)
if args.is_pull:
if args.type == "pull":
add_env("PULL_ID", data["pull_id"], env_file)
add_env("PULL_NAME", data["pull_name"], env_file)