Skip to content

field addition and deletion #22

field addition and deletion

field addition and deletion #22

name: Update changelog for Source Data
on:
push:
branches:
- patch/update-source-data-schema-changelog
concurrency:
group: ${{ github.workflow }}-${{ github.ref_protected == 'true' && github.sha || github.ref }}-{{ github.event_name }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Run Bash Script
run: |
set -x
cd $GITHUB_WORKSPACE
cp -r schemas/ new_schemas/
git clone --branch master https://github.com/stellar/stellar-etl-airflow.git repo_master_copy
cp -r repo_master_copy/schemas/ original_schemas/
output=$(python3 scripts/get_source_data_schema_changelog.py)
if [[ -n "$output" ]]; then
existing_changelog=$(<changelog/source_data.md)
echo "$output" > changelog/source_data.md
echo "$existing_changelog" >> changelog/source_data.md
fi
- name: Commit changes
id: commit_changes
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add changelog/source_data.md
if git commit -m "Update changelog for Source data"; then
echo "Changes committed."
echo "changes_committed=true" >> $GITHUB_OUTPUT
else
echo "No changes to commit."
echo "changes_committed=false" >> $GITHUB_OUTPUT
fi
- name: Push branch
if: steps.commit_changes.outputs.changes_committed == 'true'
run: |
git push