-
Notifications
You must be signed in to change notification settings - Fork 17
44 lines (35 loc) · 1.32 KB
/
comment-on-version-bump-pr.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
###########################################################################
#
# If there are new commits on main, while we have a version bump PR open,
# this job automatically comments on the PR, mentioning the new commits,
# so we will not forget to follow-up the changes.
#
###########################################################################
name: Comment on version bump PR
permissions: write-all
on:
push:
branches:
- main
jobs:
comment-on-version-bump-pr:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMMIT_URL: https://github.com/${{ github.repository_owner }}/axosyslog/commit/${{ github.sha }}
steps:
- name: Checkout AxoSyslog source
uses: actions/checkout@v4
- name: Check if version bump PR is open
run: |
. .github/workflows/gh-tools.sh
PR_NUMBER=$(gh pr list --state "open" --label "version-bump" --json "number" --jq ".[0].number")
[ -z ${PR_NUMBER} ] && echo "No version bump PR is open. Skipping."
gh_export PR_NUMBER
- name: Comment
if: env.PR_NUMBER != ''
run: |
COMMENT="There are new commits (${COMMIT_URL}) on main. Please follow-up any necessary changes."
gh pr comment \
"${PR_NUMBER}" \
--body "${COMMENT}"