forked from dataform-co/dataform
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcloudbuild-version.yaml
23 lines (23 loc) · 1 KB
/
cloudbuild-version.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
steps:
# We have github personal access token stored in `github-token-access` secret in our GCP project.
# This step downloads it and store it in token.txt file for later steps to use for authentication.
- name: gcr.io/cloud-builders/gcloud
entrypoint: 'bash'
args: [ '-c', "gcloud secrets versions access latest --secret=github-token-access --format='get(payload.data)' | tr '_-' '/+' | base64 -d > token.txt" ]
- name: gcr.io/cloud-builders/git
entrypoint: 'bash'
args:
- '-c'
- |
_GITHUB_USER=$_GITHUB_USER _GITHUB_EMAIL=$_GITHUB_EMAIL ./scripts/create_gh_pr
- name: 'gcr.io/$PROJECT_ID/github'
entrypoint: 'bash'
args:
- '-c'
- |
set -e
echo "Create PR..."
gh auth login --with-token < token.txt
gh pr create -t "Publishing Dataform security patches" -b "Updating NPM package version to $(cat version.bzl | grep DF_VERSION | awk '{ print $3 }' | sed "s/\"//g")" -B $BRANCH_NAME -H $(cat git_branch_name.txt) -r dataform-co/dataform-reviewers
options:
automapSubstitutions: true