Skip to content

Commit 6a13724

Browse files
committed
Updated test coverage script and added auto pr response
1 parent 6dffe6f commit 6a13724

2 files changed

Lines changed: 58 additions & 3 deletions

File tree

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: "Auto-Close External PRs"
2+
3+
on:
4+
pull_request_target:
5+
types: [opened]
6+
workflow_dispatch:
7+
8+
jobs:
9+
close-on-open:
10+
if: github.event_name == 'pull_request_target' && github.event.pull_request.user.login != github.repository_owner
11+
runs-on: ubuntu-latest
12+
permissions:
13+
pull-requests: write
14+
issues: write
15+
steps:
16+
- uses: actions/github-script@v7
17+
with:
18+
script: |
19+
const pr = context.issue.number;
20+
await github.rest.issues.createComment({
21+
owner: context.repo.owner,
22+
repo: context.repo.repo,
23+
issue_number: pr,
24+
body: "Thanks for the interest! This repository isn't currently accepting external contributions as I am actively experimenting with different approaches and want to avoid merge conflicts. Therefore, this PR is being closed automatically by Github Bot."
25+
});
26+
await github.rest.pulls.update({
27+
owner: context.repo.owner,
28+
repo: context.repo.repo,
29+
pull_number: pr,
30+
state: "closed"
31+
});
32+
33+
sweep-existing:
34+
if: github.event_name == 'workflow_dispatch'
35+
runs-on: ubuntu-latest
36+
permissions:
37+
pull-requests: write
38+
issues: write
39+
steps:
40+
- uses: actions/github-script@v7
41+
with:
42+
script: |
43+
const owner = context.repo.owner;
44+
const repo = context.repo.repo;
45+
const prs = await github.paginate(github.rest.pulls.list, {
46+
owner, repo, state: 'open', per_page: 100
47+
});
48+
for (const pr of prs) {
49+
if (pr.user.login === owner) continue;
50+
core.info(`Closing PR #${pr.number} by ${pr.user.login}`);
51+
await github.rest.issues.createComment({
52+
owner, repo, issue_number: pr.number,
53+
body: "Thanks for the interest! This repository isn't currently accepting external contributions as I am actively experimenting with different approaches and want to avoid merge conflicts. Therefore, this PR is being closed automatically by Github Bot."
54+
});
55+
await github.rest.pulls.update({
56+
owner, repo, pull_number: pr.number, state: "closed"
57+
});
58+
}

scripts/local_test_coverage.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ xcodebuild \
1313
-resultBundlePath TestResult/ \
1414
-enableCodeCoverage YES \
1515
-derivedDataPath "/tmp" \
16-
HEADER_SEARCH_PATHS="./external/libpqxx/include/pqxx/internal ./external/libpqxx/include/ ./external/libpqxx/build/include/ ./external/" \
17-
LIBRARY_SEARCH_PATHS="./external/libpqxx/src/ ./external/libpqxx/build/src/" \
18-
OTHER_LDFLAGS="-L./external/libpqxx/build/src -lpqxx -lpq -L/opt/homebrew/Cellar/pkgconf/2.3.0_1/lib -L/opt/homebrew/Cellar/pkgconf/2.3.0_1/lib/pkgconfig -L/opt/homebrew/Cellar/postgresql@14/14.15/lib/postgresql@14 -L/opt/homebrew/Cellar/postgresql@14/14.15/lib/postgresql@14/pgxs -L/opt/homebrew/Cellar/postgresql@14/14.15/lib/postgresql@14/pkgconfig" \
1916
clean build test
2017

2118
bash ./.github/workflows/xccov-to-sonarqube-generic.sh *.xcresult/ > sonarqube-generic-coverage.xml

0 commit comments

Comments
 (0)