Skip to content

Commit

Permalink
reset key, and personalised commit messages.
Browse files Browse the repository at this point in the history
  • Loading branch information
CMIP-IPO: Automated GitHub Action committed Nov 18, 2023
1 parent d20cc06 commit 434d915
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
9 changes: 8 additions & 1 deletion .github/libs/reset_versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,11 @@ json_files=$(grep -rl '"version_metadata"' Auxillary*/*.json)
# Iterate over each JSON file and update the 'checksum' element
for json_file in $json_files; do
jq '.version_metadata.checksum = "reset"' "$json_file" > "$json_file.tmp" && mv "$json_file.tmp" "$json_file"
done
done

git add -A
git commit -m 'reset_checksum'
git push


# make sure your commit message is 'reset_checksum'
16 changes: 15 additions & 1 deletion .github/libs/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import argparse
from urllib.request import Request, urlopen
from checksum_tools import validate_checksum,calculate_checksum

from datetime import datetime

##########################################
# load the maintainer file
Expand Down Expand Up @@ -99,6 +99,8 @@ def get_latest_tag_info(repo_owner, repo_name, github_token=None):

commit_blocks = re.split(r'\n(?=commit\s)', full)
for c in commit_blocks:
if 'reset-checksum' in c:
continue
if skip not in c:
if not commit_info:
commit_info = c
Expand Down Expand Up @@ -185,6 +187,18 @@ def get_latest_tag_info(repo_owner, repo_name, github_token=None):
write.write(json.dumps(contents,indent=4))



##########################################
# keep the individualised commit messages
##########################################

timestamp_obj = datetime.strptime(commit_dict['commit_date'].lstrip(), "%a %b %d %H:%M:%S %Y %z")
formatted_timestamp = timestamp_obj.strftime("%y/%m/%d %H:%M")

os.popen(f"git add {f}")
os.popen(f"git commit -m '{formatted_timestamp} - {commit_dict['commit_message'][:50]}")


# checksum. If checksum is not the same, update.


Expand Down

0 comments on commit 434d915

Please sign in to comment.