Skip to content

Commit

Permalink
Update changelog using fresh changelog file from master
Browse files Browse the repository at this point in the history
update
  • Loading branch information
amishas157 committed Nov 6, 2024
1 parent d6ca427 commit 1a7666c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/update_source_data_schema_changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,16 @@ jobs:
set -x
cd $GITHUB_WORKSPACE
OLD_SCHEMAS_DIR=original_schemas
OLD_CHANGELOG_FILEPATH=original_changelog.md
git clone --branch master https://github.com/stellar/stellar-etl-airflow.git repo_master_copy
mkdir OLD_SCHEMAS_DIR
cp -r repo_master_copy/schemas/ $OLD_SCHEMAS_DIR/
cp repo_master_copy/changelog/source_data.md $OLD_CHANGELOG_FILEPATH
export OLD_SCHEMAS_DIR
export OLD_CHANGELOG_FILEPATH
python3 scripts/update_source_data_schema_changelog.py
rm -rf $OLD_SCHEMAS_DIR
rm $OLD_CHANGELOG_FILEPATH
rm -rf repo_master_copy
- name: Commit and Push Changes
Expand Down
4 changes: 2 additions & 2 deletions scripts/update_source_data_schema_changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
from datetime import datetime

OLD_SCHEMAS_DIR = os.environ.get("OLD_SCHEMAS_DIR")
OLD_CHANGELOG_FILEPATH = os.environ.get("OLD_CHANGELOG_FILEPATH")
NEW_SCHEMAS_DIR = "schemas"
CHANGELOG_FILEPATH = "changelog/source_data.md"


def read_json_file(filepath: str) -> {}:
with open(filepath, "r") as rfp:
try:
Expand Down Expand Up @@ -173,7 +173,7 @@ def generate_changelog(schemas_added=[], schemas_deleted=[], schemas_changes={})


def main():
existing_changelog = read_file(filepath=CHANGELOG_FILEPATH)
existing_changelog = read_file(filepath=OLD_CHANGELOG_FILEPATH)
old_schema_filepaths = list_files_in_dir(directory=OLD_SCHEMAS_DIR)
new_schema_filepaths = list_files_in_dir(directory=NEW_SCHEMAS_DIR)

Expand Down

0 comments on commit 1a7666c

Please sign in to comment.