Skip to content

Commit ced3575

Browse files
committed
Update workflow files from stardust-npm-scripts
1 parent 38deddd commit ced3575

File tree

4 files changed

+60
-40
lines changed

4 files changed

+60
-40
lines changed

.github/workflows/build.yaml

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# These workflows are copied from stardust-npm-scripts. Edit them there.
12
---
23
name: Lint, test and build
34
on: push
@@ -49,39 +50,3 @@ jobs:
4950
- run: npm run build
5051

5152
- run: npm run lint
52-
53-
dependabot_auto_merge:
54-
runs-on: ubuntu-latest
55-
if: ${{ github.actor == 'dependabot[bot]' }}
56-
steps:
57-
- uses: google-github-actions/auth@v0
58-
id: auth
59-
with:
60-
workload_identity_provider: projects/${{ env.GCLOUD_PROJECT_ID }}/locations/global/workloadIdentityPools/github/providers/github-actions
61-
service_account: github-actions@${{ env.GCLOUD_PROJECT_NAME }}.iam.gserviceaccount.com
62-
63-
- name: Get common secrets
64-
id: secrets
65-
uses: google-github-actions/get-secretmanager-secrets@v0
66-
with:
67-
secrets: |-
68-
github:${{ env.GCLOUD_PROJECT_NAME }}/github
69-
70-
- name: Dependabot metadata
71-
id: metadata
72-
uses: dependabot/[email protected]
73-
with:
74-
github-token: ${{ fromJson(steps.secrets.outputs.github).token }}
75-
76-
- name: Automatically approve the PR
77-
run: gh pr review --approve "${PR_URL}"
78-
env:
79-
PR_URL: ${{github.event.pull_request.html_url}}
80-
GITHUB_TOKEN: ${{ fromJson(steps.secrets.outputs.github).token }}
81-
82-
- name: Enable auto-merge for patch or minor version updates
83-
if: "${{ steps.metadata.outputs.update-type == 'version-update:semver-patch' || steps.metadata.outputs.update-type == 'version-update:semver-minor' }}"
84-
run: gh pr merge --auto --merge "${PR_URL}"
85-
env:
86-
PR_URL: ${{github.event.pull_request.html_url}}
87-
GITHUB_TOKEN: ${{ fromJson(steps.secrets.outputs.github).token }}

.github/workflows/dependabot.yaml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# These workflows are copied from stardust-npm-scripts. Edit them there.
2+
---
3+
name: Auto-merge dependabot
4+
on:
5+
pull_request:
6+
types: [opened, synchronize, reopened, labeled, unlabeled]
7+
8+
env:
9+
GCLOUD_PROJECT_NAME: um-cloud-production
10+
GCLOUD_PROJECT_ID: 72990522503
11+
12+
permissions:
13+
# Needed to clone the repo
14+
contents: read
15+
# Needed for Workload Identity
16+
id-token: write
17+
18+
jobs:
19+
dependabot_auto_merge:
20+
runs-on: ubuntu-latest
21+
if: ${{ github.actor == 'dependabot[bot]' }}
22+
steps:
23+
- uses: google-github-actions/auth@v0
24+
id: auth
25+
with:
26+
workload_identity_provider: projects/${{ env.GCLOUD_PROJECT_ID }}/locations/global/workloadIdentityPools/github/providers/github-actions
27+
service_account: github-actions@${{ env.GCLOUD_PROJECT_NAME }}.iam.gserviceaccount.com
28+
29+
- name: Get common secrets
30+
id: secrets
31+
uses: google-github-actions/get-secretmanager-secrets@v0
32+
with:
33+
secrets: |-
34+
github:${{ env.GCLOUD_PROJECT_NAME }}/github
35+
36+
- name: Dependabot metadata
37+
id: metadata
38+
uses: dependabot/[email protected]
39+
with:
40+
github-token: ${{ fromJson(steps.secrets.outputs.github).token }}
41+
42+
- name: Automatically approve the PR
43+
run: gh pr review --approve "${PR_URL}"
44+
env:
45+
PR_URL: ${{github.event.pull_request.html_url}}
46+
GITHUB_TOKEN: ${{ fromJson(steps.secrets.outputs.github).token }}
47+
48+
- name: Enable auto-merge for patch or minor version updates
49+
if: "${{ steps.metadata.outputs.update-type == 'version-update:semver-patch' || steps.metadata.outputs.update-type == 'version-update:semver-minor' }}"
50+
run: gh pr merge --auto --merge "${PR_URL}"
51+
env:
52+
PR_URL: ${{github.event.pull_request.html_url}}
53+
GITHUB_TOKEN: ${{ fromJson(steps.secrets.outputs.github).token }}

.github/workflows/publish-beta.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# These workflows are copied from stardust-npm-scripts. Edit them there.
12
---
23
name: Lint, test, build, and publish
34
on:
@@ -14,8 +15,8 @@ permissions:
1415
contents: read
1516
# Needed for Workload Identity
1617
id-token: write
17-
# Needed to pull docker images / write NPM packages
18-
packages: write
18+
# Needed to pull docker images
19+
packages: read
1920

2021
jobs:
2122
publish:

.github/workflows/publish.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# These workflows are copied from stardust-npm-scripts. Edit them there.
12
---
23
name: Lint, test, build, and publish
34
on:
@@ -14,8 +15,8 @@ permissions:
1415
contents: read
1516
# Needed for Workload Identity
1617
id-token: write
17-
# Needed to pull docker images / write NPM packages
18-
packages: write
18+
# Needed to pull docker images
19+
packages: read
1920

2021
jobs:
2122
publish:

0 commit comments

Comments
 (0)