-
Notifications
You must be signed in to change notification settings - Fork 347
69 lines (60 loc) · 2.39 KB
/
Copy pathscheduled-publishing.yml
File metadata and controls
69 lines (60 loc) · 2.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# **what?**
# Automatically publishes all adapter packages to the internal AWS CodeArtifact repository on a schedule.
# **why?**
# Ensures internal tools always have access to the latest versions of adapter packages.
# **when?**
# This workflow runs on a schedule every Sunday at midnight UTC.
name: "Scheduled publishing"
run-name: "Scheduled publishing - ${{ github.actor }}"
on:
schedule:
- cron: "0 0 * * SUN"
permissions:
id-token: write
contents: read
jobs:
publish:
strategy:
matrix:
package:
- "dbt-athena"
- "dbt-bigquery"
- "dbt-postgres"
- "dbt-redshift"
- "dbt-snowflake"
- "dbt-spark"
fail-fast: false
uses: ./.github/workflows/publish-internal.yml
with:
package: ${{ matrix.package }}
secrets: inherit
open-lockfile-pr:
needs: publish
runs-on: ${{ vars.DEFAULT_RUNNER }}
steps:
- name: "Trigger lockfile PR and get PR number"
id: pr
shell: bash
run: |
RUN_ID=$(gh workflow run $WORKFLOW --repo $REPO)
echo $RUN_ID
gh run watch $RUN_ID
PR=$(gh pr list --repo $REPO --search "$PR_TITLE in:title" --json number | jq 'max .number')
echo $PR
echo "number=$PR" >> $GITHUB_OUTPUT
env:
GH_TOKEN: ${{ secrets.FISHTOWN_BOT_PAT }}
REPO: "dbt-labs/dbt-mantle"
WORKFLOW: "open-lockfile-pr.yml"
PR_TITLE: "Generate new lockfile for dbt-mantle"
- name: "Notify Slack"
uses: ravsamhq/notify-slack-action@be814b201e233b2dc673608aa46e5447c8ab13f2 # ravsamhq/notify-slack-action@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
status: ${{ job.status }}
notification_title: "dbt-mantle lockfile is ready for review"
message_format: "View PR: https://github.com/dbt-labs/dbt-mantle/pull/${{ steps.pr.outputs.number }}"
mention_groups: ${{ vars.SLACK_ON_CALL }}
mention_groups_when: "success"
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_DEV_ADAPTER_PULL_REQUESTS }}