-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
46 lines (46 loc) · 1.62 KB
/
action.yml
File metadata and controls
46 lines (46 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: 'CodeKeepers Review Request Action'
description: 'Automatically post your Pull Requests for review at the CodeKeepers Discord Server'
author: 'CodeKeepers'
branding:
icon: 'check'
color: 'green'
inputs:
api_token:
description: 'API token for authenticating with the CodeKeepers endpoint'
required: true
runs:
using: "composite"
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Check repository privacy
run: |
if [ "${{ github.event.repository.private }}" = "true" ]; then
echo "Repository is private. Exiting."
exit 1
fi
shell: bash
- name: Check README badge
run: |
if ! grep -q 'Join CodeKeepers' README.md; then
echo "Badge not found in README.md. DM vulps on discord to ask for verification"
exit 1
fi
shell: bash
- name: Verify badge commit author
run: |
line=$(grep -n 'Join CodeKeepers' README.md | cut -d: -f1 | head -n 1)
blame=$(git blame -L ${line},${line} README.md)
echo "$blame"
if ! echo "$blame" | grep -q "Vulps"; then
echo "Badge was not committed by Vulps22. The badge must be committed by Vulps22 to be authentic"
exit 1
fi
shell: bash
- name: Send review request
run: |
curl -X POST https://vulps.co.uk/codekeepers/api/review-request \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${{ inputs.api_token }}" \
-d "{\"url\": \"${{ github.event.pull_request.html_url }}\", \"username\": \"${{ github.repository_owner }}\"}"
shell: bash