Skip to content

Commit 8b32438

Browse files
authored
update workflow to add full refresh to title [deploy:full-refresh] (#248)
* update workflow to add full refresh to title * force a change in transform
1 parent 33b6181 commit 8b32438

File tree

2 files changed

+17
-16
lines changed

2 files changed

+17
-16
lines changed

.github/workflows/20_release_dbt_checks.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ jobs:
2020
add-deploy-marker:
2121
if: github.event.action == 'labeled' && github.event.label.name == 'full-refresh'
2222
runs-on: ubuntu-latest
23-
name: Add Deploy Marker to PR Description
23+
name: Add Deploy Marker to PR Title
2424

2525
steps:
26-
- name: Add deploy marker to PR description
26+
- name: Add deploy marker to PR title
2727
uses: actions/github-script@v6
2828
with:
2929
script: |
@@ -33,36 +33,36 @@ jobs:
3333
pull_number: context.issue.number
3434
});
3535
36-
let body = pullRequest.body || '';
36+
let title = pullRequest.title || '';
3737
3838
// Check if marker already exists
39-
if (!body.includes('[deploy:full-refresh]')) {
40-
// Add marker to the end of the description
41-
const newBody = body + '\n\n[deploy:full-refresh]';
39+
if (!title.includes('[deploy:full-refresh]')) {
40+
// Add marker to the end of the title
41+
const newTitle = title + ' [deploy:full-refresh]';
4242
4343
await github.rest.pulls.update({
4444
owner: context.repo.owner,
4545
repo: context.repo.repo,
4646
pull_number: context.issue.number,
47-
body: newBody
47+
title: newTitle
4848
});
4949
5050
// Also add a comment explaining what happened
5151
await github.rest.issues.createComment({
5252
owner: context.repo.owner,
5353
repo: context.repo.repo,
5454
issue_number: context.issue.number,
55-
body: '🚀 **Full-refresh deployment marker added to PR description**\n\nThe `[deploy:full-refresh]` marker has been automatically added to this PR description. When merged, this will trigger a full-refresh deployment.'
55+
body: '🚀 **Full-refresh deployment marker added to PR title**\n\nThe `[deploy:full-refresh]` marker has been automatically added to this PR title. When merged, this will trigger a full-refresh deployment.'
5656
});
5757
}
5858
5959
remove-deploy-marker:
6060
if: github.event.action == 'unlabeled' && github.event.label.name == 'full-refresh'
6161
runs-on: ubuntu-latest
62-
name: Remove Deploy Marker from PR Description
62+
name: Remove Deploy Marker from PR Title
6363

6464
steps:
65-
- name: Remove deploy marker from PR description
65+
- name: Remove deploy marker from PR title
6666
uses: actions/github-script@v6
6767
with:
6868
script: |
@@ -72,25 +72,25 @@ jobs:
7272
pull_number: context.issue.number
7373
});
7474
75-
let body = pullRequest.body || '';
75+
let title = pullRequest.title || '';
7676
7777
// Remove the marker if it exists
78-
if (body.includes('[deploy:full-refresh]')) {
79-
const newBody = body.replace(/\n*\[deploy:full-refresh\]\n*/g, '').trim();
78+
if (title.includes('[deploy:full-refresh]')) {
79+
const newTitle = title.replace(/\s*\[deploy:full-refresh\]\s*/g, '').trim();
8080
8181
await github.rest.pulls.update({
8282
owner: context.repo.owner,
8383
repo: context.repo.repo,
8484
pull_number: context.issue.number,
85-
body: newBody
85+
title: newTitle
8686
});
8787
8888
// Add a comment explaining what happened
8989
await github.rest.issues.createComment({
9090
owner: context.repo.owner,
9191
repo: context.repo.repo,
9292
issue_number: context.issue.number,
93-
body: '✅ **Full-refresh deployment marker removed**\n\nThe `[deploy:full-refresh]` marker has been removed from this PR description. Normal deployment will occur on merge.'
93+
body: '✅ **Full-refresh deployment marker removed**\n\nThe `[deploy:full-refresh]` marker has been removed from this PR title. Normal deployment will occur on merge.'
9494
});
9595
}
9696
@@ -249,5 +249,5 @@ jobs:
249249
${{ needs.dbt.result == 'skipped' && '⏭️ _dbt validations skipped_' || '' }}
250250
${{ needs.dbt.result == 'success' && '✅ _All dbt validations passed_' || '' }}
251251
${{ needs.dbt.result == 'failure' && '❌ _dbt validations failed_' || '' }}
252-
${{ (needs.add-deploy-marker.result == 'success' || needs.remove-deploy-marker.result == 'success') && '📝 _Deploy marker updated in PR description_' || '' }}
252+
${{ (needs.add-deploy-marker.result == 'success' || needs.remove-deploy-marker.result == 'success') && '📝 _Deploy marker updated in PR title_' || '' }}
253253
comment_tag: dbt-workflow-status

transform/models/L3_coves/earthquake_analytics/earthquakes_around_the_world.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,5 @@ final as (
4545
)
4646
)
4747

48+
4849
select * from final

0 commit comments

Comments
 (0)