Skip to content

Update changelog for DBT marts #28

Update changelog for DBT marts

Update changelog for DBT marts #28

name: Update changelog for DBT marts
on:
schedule:
- cron: "0 23 * * 1-5" # This will run at 11 PM UTC, which is 5 PM CST
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: Authenticate to crypto-stellar GCP
uses: "google-github-actions/auth@v2"
with:
project_id: hubble-261722
credentials_json: "${{ secrets.CREDS_PROD_HUBBLE }}"
- name: Set up Google Cloud SDK
run: |
echo "Installing Google Cloud SDK..."
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -
sudo apt-get update && sudo apt-get install -y google-cloud-sdk
- name: Create new branch
id: create_branch
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
BRANCH_NAME="update-data-schema-changelog-${{ github.run_id }}"
git checkout -b $BRANCH_NAME
echo "::set-output name=branch::$BRANCH_NAME"
- name: Run Bash Script
run: |
cd $GITHUB_WORKSPACE
PROJECT=hubble-261722
export PROJECT
output=$(. scripts/update_dbt_marts_schema_changelog.sh)
echo "$output" > changelog/dbt_marts.md
# - name: Commit changes
# id: commit_changes
# run: |
# git add changelog/dbt_marts.md
# if git commit -m "Update changelog for DBT marts"; 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 origin ${{ steps.create_branch.outputs.branch }}
# - name: Create Pull Request
# if: steps.commit_changes.outputs.changes_committed == 'true'
# run: |
# gh pr create -B master -H ${{ steps.create_branch.outputs.branch }} \
# --title 'Update schema changelog for DBT marts' \
# --body 'This is an autogenerated PR to update schema changelog for marts.'
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}