-
Notifications
You must be signed in to change notification settings - Fork 2
62 lines (50 loc) · 1.85 KB
/
help_requester.yml
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Notify Software Leads on Help Request
on:
push:
branches-ignore:
- 'development'
jobs:
notify-discord:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Fetch all branches and commits
run: git fetch --all
- name: Extract LEAD comments for each commit
run: |
# Get the list of commits included in this push from the event JSON file
commits=$(jq -r '.commits[].id' "$GITHUB_EVENT_PATH")
# Print out the list of commits
echo "Commits to process:"
for commit in $commits; do
echo " - $commit"
done
# Process each commit
for commit in $commits; do
echo "Processing commit: $commit"
# Checkout the specific commit
git checkout "$commit"
# Run the LEAD comments extraction and Discord notification script
chmod +x ./tools/help-request/extract_comments.sh
chmod +x ./tools/help-request/send_discord.sh
# Extract LEAD comments
./tools/help-request/extract_comments.sh "$commit"
done
# Check if any comment files were created
if [ "$(ls -A comments)" ]; then
echo "LEAD comments have been extracted and saved in the comments directory."
# Send Discord notification if comment files exist
./tools/help-request/send_discord.sh
else
echo "No LEAD comments were found in commit $commit. No notification will be sent."
fi
# Clean up the comments directory for the next commit
rm -rf comments/*
shell: bash
env:
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
SOFTWARE_LEADS_ROLE_ID: ${{ secrets.SOFTWARE_LEADS_ROLE_ID }}