-
Notifications
You must be signed in to change notification settings - Fork 8
38 lines (35 loc) · 1.04 KB
/
COMMENT_DEVELOP_FIX.yml
File metadata and controls
38 lines (35 loc) · 1.04 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
name: COMMENT_DEVELOP_FIX
on:
workflow_dispatch:
# push:
# branches:
# - main
# pull_request:
# types:
# - opened
permissions:
pull-requests: write
jobs:
comment:
name: Comment on fix to develop
runs-on: ubuntu-latest
steps:
- name: Check for fix commits
env:
COMMITS_URL: ${{ github.event.pull_request.commits_url }}
run: |
echo "Checking commits via $COMMITS_URL"
if [[ $(curl $COMMITS_URL) =~ ."\"message\": \"fix".* ]]
then
echo "FIX_COMMITS_PRESENT=true" >> $GITHUB_ENV
else
echo "FIX_COMMITS_PRESENT=false" >> $GITHUB_ENV
fi
- name: Create comment
if: ${{ env.FIX_COMMITS_PRESENT == 'true' }}
uses: peter-evans/create-or-update-comment@805e17198fdf76804c4e28754d00cedfffb58058
with:
issue-number: ${{ github.event.number }}
body: |
This Pull Request targets `develop` branch, but contains `fix` commits.
Consider targeting `main` instead.