Skip to content

Commit 500d2af

Browse files
committed
fix: fork tests
1 parent 04b6f79 commit 500d2af

File tree

2 files changed

+24
-76
lines changed

2 files changed

+24
-76
lines changed

.github/workflows/code_health_fork.yaml

Lines changed: 2 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ permissions: {}
1010
jobs:
1111
run-tests:
1212
name: Run MongoDB tests
13-
if: github.event.pull_request.user.login == 'dependabot[bot]' || github.event.pull_request.head.repo.full_name != github.repository
13+
if: github.event.pull_request.head.repo.full_name != github.repository
1414
runs-on: ubuntu-latest
1515
steps:
16+
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
1617
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
1718
- uses: actions/checkout@v4
1819
- uses: actions/setup-node@v4
@@ -29,78 +30,3 @@ jobs:
2930
with:
3031
name: test-results
3132
path: coverage/lcov.info
32-
33-
run-atlas-tests:
34-
name: Run Atlas tests
35-
if: github.event.pull_request.user.login == 'dependabot[bot]' || github.event.pull_request.head.repo.full_name != github.repository
36-
runs-on: ubuntu-latest
37-
steps:
38-
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
39-
- uses: actions/checkout@v4
40-
- uses: actions/setup-node@v4
41-
with:
42-
node-version-file: package.json
43-
cache: "npm"
44-
- name: Install dependencies
45-
run: npm ci
46-
- name: Run tests
47-
env:
48-
MDB_MCP_API_CLIENT_ID: ${{ secrets.TEST_ATLAS_CLIENT_ID }}
49-
MDB_MCP_API_CLIENT_SECRET: ${{ secrets.TEST_ATLAS_CLIENT_SECRET }}
50-
MDB_MCP_API_BASE_URL: ${{ vars.TEST_ATLAS_BASE_URL }}
51-
run: npm test -- --testPathIgnorePatterns "tests/integration/tools/mongodb" --testPathIgnorePatterns "tests/integration/[^/]+\.ts"
52-
- name: Upload test results
53-
uses: actions/upload-artifact@v4
54-
if: always()
55-
with:
56-
name: atlas-test-results
57-
path: coverage/lcov.info
58-
59-
coverage:
60-
name: Report Coverage
61-
if: always() && github.event.pull_request.user.login == 'dependabot[bot]' || github.event.pull_request.head.repo.full_name != github.repository
62-
runs-on: ubuntu-latest
63-
needs: [run-tests, run-atlas-tests]
64-
steps:
65-
- uses: actions/checkout@v4
66-
- uses: actions/setup-node@v4
67-
with:
68-
node-version-file: package.json
69-
cache: "npm"
70-
- name: Install dependencies
71-
run: npm ci
72-
- name: Download test results
73-
uses: actions/download-artifact@v4
74-
with:
75-
name: test-results
76-
path: coverage/mongodb
77-
- name: Download atlas test results
78-
uses: actions/download-artifact@v4
79-
with:
80-
name: atlas-test-results
81-
path: coverage/atlas
82-
- name: Merge coverage reports
83-
run: |
84-
npx -y [email protected] "coverage/*/lcov.info" "coverage/lcov.info"
85-
- name: Coveralls GitHub Action
86-
uses: coverallsapp/[email protected]
87-
with:
88-
file: coverage/lcov.info
89-
git-branch: ${{ github.head_ref || github.ref_name }}
90-
git-commit: ${{ github.event.pull_request.head.sha || github.sha }}
91-
92-
merge-dependabot-pr:
93-
name: Merge Dependabot PR
94-
if: github.event.pull_request.user.login == 'dependabot[bot]'
95-
runs-on: ubuntu-latest
96-
permissions:
97-
pull-requests: write
98-
contents: write
99-
needs:
100-
- coverage
101-
steps:
102-
- name: Enable auto-merge for Dependabot PRs
103-
run: gh pr merge --auto --squash "$PR_URL"
104-
env:
105-
PR_URL: ${{github.event.pull_request.html_url}}
106-
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

.github/workflows/dependabot.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
name: Enable Auto Merge on Dependabot PRs
3+
on:
4+
pull_request:
5+
6+
permissions: {}
7+
8+
jobs:
9+
merge-dependabot-pr:
10+
name: Merge Dependabot PR
11+
if: github.event.pull_request.user.login == 'dependabot[bot]'
12+
runs-on: ubuntu-latest
13+
permissions:
14+
pull-requests: write
15+
contents: write
16+
steps:
17+
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
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}}

0 commit comments

Comments
 (0)