chore: auto-close stale issues #259
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Code Health (fork) | |
on: | |
pull_request_target: | |
branches: | |
- main | |
permissions: {} | |
jobs: | |
run-tests: | |
name: Run MongoDB tests | |
if: github.event.pull_request.user.login == 'dependabot[bot]' || github.event.pull_request.head.repo.full_name != github.repository | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
fail-fast: false | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: GitHubSecurityLab/actions-permissions/monitor@v1 | |
if: matrix.os != 'windows-latest' | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: package.json | |
cache: "npm" | |
- name: Install dependencies | |
run: npm ci | |
- name: Run tests | |
run: npm test | |
- name: Upload test results | |
if: always() && matrix.os == 'ubuntu-latest' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: test-results | |
path: coverage/lcov.info | |
merge-dependabot-pr: | |
name: Merge Dependabot PR | |
if: github.event.pull_request.user.login == 'dependabot[bot]' | |
runs-on: ubuntu-latest | |
permissions: | |
pull-requests: write | |
contents: write | |
steps: | |
- name: Enable auto-merge for Dependabot PRs | |
run: gh pr merge --auto --squash "$PR_URL" | |
env: | |
PR_URL: ${{github.event.pull_request.html_url}} | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |