Skip to content

Commit 9dab8f1

Browse files
contributor-check (#468)
Summary: - Add a PR check for starring this repository. - Leverages stackql tooling.
1 parent 22bf728 commit 9dab8f1

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

.github/workflows/contribute.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Check if PR author has starred the repository
2+
on:
3+
pull_request:
4+
types: [opened, synchronize, reopened]
5+
6+
jobs:
7+
check-starred:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Checkout code
12+
uses: actions/[email protected]
13+
14+
- name: Pull github provider
15+
uses: stackql/[email protected]
16+
with:
17+
is_command: 'true'
18+
query: "REGISTRY PULL github;"
19+
20+
- name: Run stackql query
21+
id: check-star
22+
uses: stackql/[email protected]
23+
with:
24+
test_query: |
25+
SELECT repo, count(*) as has_starred
26+
FROM github.activity.repo_stargazers
27+
WHERE owner = 'stackql' and repo in ('stackql') and login = '${{ github.event.pull_request.user.login }}'
28+
GROUP BY repo;
29+
expected_results_str: '[{"has_starred":"1","repo":"stackql"}]'
30+
continue-on-error: true
31+
32+
- name: Check if starred
33+
run: |
34+
if [ "${{ steps.check-star.outcome }}" = "success" ]; then
35+
echo "Thanks for your support by starring both StackQL repositories!"
36+
else
37+
echo "It seems you haven't starred the StackQL repositories. Please star the following repos before proceeding:"
38+
echo "https://github.com/stackql/stackql (our core repo)"
39+
exit 1
40+
fi
41+
if: always()

CONTRIBUTING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ Before beginning implementation work, please raise an issue and receive a consen
1111

1212
Please raise pull requests (PRs) from a fork of this repository, using the provided PR template. The richer the detail / evidence supplied, the easier the review process. A usefully named feature branch for the PR source is appreciated.
1313

14+
Finally, in respect of all your efforts; we thank you and ask that you please give us a star while you are at it.
15+
1416
Many Thanks,
1517

1618
The StackQL team.

0 commit comments

Comments
 (0)