Skip to content

Commit 5bb8fca

Browse files
chore: reconfigures workflow for dependabot and forked PRs VSCODE-708 (#1171)
1 parent 628f69f commit 5bb8fca

File tree

3 files changed

+29
-21
lines changed

3 files changed

+29
-21
lines changed

.github/dependabot.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ updates:
66
directory: /
77
schedule:
88
interval: daily
9+
cooldown:
10+
default-days: 7
11+
include:
12+
- "*"
913
allow:
1014
- dependency-name: mongodb
1115
- dependency-name: bson
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
name: Dependabot PR
3+
on:
4+
pull_request_target:
5+
types: [opened]
6+
branches:
7+
- main
8+
9+
permissions:
10+
pull-requests: write
11+
12+
jobs:
13+
enable-auto-merge-on-dependabot-pr:
14+
name: Enable auto-merge for Dependabot PRs
15+
if: github.event.pull_request.user.login == 'dependabot[bot]'
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Enable auto-merge for Dependabot PRs
19+
run: gh pr merge --auto --squash "$PR_URL"
20+
env:
21+
PR_URL: ${{github.event.pull_request.html_url}}
22+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
name: Test and Build (from fork)
22
on:
3-
pull_request_target:
3+
pull_request:
44
branches:
55
- main
66
permissions:
7-
contents: write
8-
pull-requests: write
7+
contents: read
98

109
jobs:
1110
test-and-build:
@@ -22,10 +21,6 @@ jobs:
2221
steps:
2322
- name: Checkout
2423
uses: actions/checkout@v4
25-
with:
26-
fetch-depth: 0
27-
ref: ${{github.event.pull_request.head.ref}}
28-
repository: ${{github.event.pull_request.head.repo.full_name}}
2924

3025
- name: Setup Node.js Environment
3126
uses: actions/setup-node@v4
@@ -44,18 +39,5 @@ jobs:
4439
- name: Run Tests
4540
env:
4641
NODE_OPTIONS: "--max_old_space_size=4096"
47-
SEGMENT_KEY: ${{ secrets.SEGMENT_KEY_DEV }}
42+
SEGMENT_KEY: "test-segment-key"
4843
run: npm run test
49-
50-
merge-dependabot-pr:
51-
name: Merge Dependabot PR
52-
runs-on: ubuntu-latest
53-
needs:
54-
- test-and-build
55-
if: github.event.pull_request.user.login == 'dependabot[bot]'
56-
steps:
57-
- name: Enable auto-merge for Dependabot PRs
58-
run: gh pr merge --auto --squash "$PR_URL"
59-
env:
60-
PR_URL: ${{github.event.pull_request.html_url}}
61-
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

0 commit comments

Comments
 (0)