diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 2fefefe..bbfb09a 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -1,11 +1,10 @@ name: Keboola Component Build & Deploy Pipeline on: - push: - branches: - - 'feature/*' - - 'bug/*' + push: # skip the workflow on the main branch without tags + branches-ignore: + - main tags: - - '*' # Skip the workflow on the main branch without tags + - "*" concurrency: ci-${{ github.ref }} # to avoid tag collisions in the ECR env: @@ -47,7 +46,7 @@ jobs: echo "branch_name=$branch_name" | tee -a $GITHUB_OUTPUT else raw=$(git branch -r --contains ${{ github.ref }}) - branch="$(echo ${raw//origin\//} | tr -d '\n')" + branch="$(echo ${raw/*origin\//} | tr -d '\n')" echo "branch_name=$branch" | tee -a $GITHUB_OUTPUT fi @@ -64,8 +63,13 @@ jobs: - name: Set image tag id: tag run: | - TAG="${GITHUB_REF##*/}" - IS_SEMANTIC_TAG=$(echo "$TAG" | grep -q '^v\?[0-9]\+\.[0-9]\+\.[0-9]\+$' && echo true || echo false) + REF="${GITHUB_REF##*/}" + if [ "${{ github.ref_type }}" = "tag" ]; then + TAG="$REF" + else + TAG="$REF-${{ github.run_number }}" + fi + IS_SEMANTIC_TAG=$(echo "$REF" | grep -q '^[0-9]\+\.[0-9]\+\.[0-9]\+$' && echo true || echo false) echo "is_semantic_tag=$IS_SEMANTIC_TAG" | tee -a $GITHUB_OUTPUT echo "app_image_tag=$TAG" | tee -a $GITHUB_OUTPUT diff --git a/src/component.py b/src/component.py index 1283c98..14f42b9 100644 --- a/src/component.py +++ b/src/component.py @@ -159,6 +159,11 @@ def get_existing_report_id(self, client): return None prev_report_id = prev_state['report']['key']['queryId'] prev_cfg = Configuration.fromDict(prev_state.get('configuration')) + # DV360 queries are scoped to account state at creation time. + # New Partners/Advertisers added after query creation are silently excluded. + # Always create a fresh query so the current account structure is reflected. + if self.cfg.input_variant == 'report_specification': + return None if prev_cfg == self.cfg: # check for query existence q = client.get_query(prev_report_id)