Skip to content

Commit

Permalink
Merge branch 'data-catalog' into 34-data-catalog-define-github-action…
Browse files Browse the repository at this point in the history
…s-workflow-for-rebuilding-and-deploying-docs-site
  • Loading branch information
jeancochrane committed Aug 8, 2023
2 parents 0aa549b + f617f52 commit 949a01b
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions .github/actions/configure_dbt_environment/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,16 @@ runs:
steps:
- name: Configure dbt environment
run: |
if [[ $GITHUB_REF_NAME == 'master' ]]; then
# GITHUB_HEAD_REF is only set on pull_request events, so if it's
# present, we must be in a PR context
if [ -n "$GITHUB_HEAD_REF" ]; then
echo "On pull request branch, setting dbt env to CI"
{
echo "TARGET=ci";
echo "CACHE_KEY=$GITHUB_HEAD_REF";
echo "HEAD_REF=$GITHUB_HEAD_REF"
} >> "$GITHUB_ENV"
elif [[ $GITHUB_REF_NAME == 'master' ]]; then
echo "On master branch, setting dbt env to prod"
{
echo "TARGET=prod";
Expand All @@ -19,11 +28,7 @@ runs:
echo "HEAD_REF=data-catalog";
} >> "$GITHUB_ENV"
else
echo "On pull request branch, setting dbt env to CI"
{
echo "TARGET=ci";
echo "CACHE_KEY=$GITHUB_HEAD_REF";
echo "HEAD_REF=$GITHUB_HEAD_REF"
} >> "$GITHUB_ENV"
echo "CI context did not match any of the expected environments"
exit 1
fi
shell: bash

0 comments on commit 949a01b

Please sign in to comment.