1 name: Check autorelease deprecation
5 types: [opened, synchronize, converted_to_draft, ready_for_review, edited]
9 name: Check autorelease deprecation
10 runs-on: ubuntu-latest
18 - uses: actions/checkout@v3
20 ref: ${{ github.event.pull_request.head.sha }}
23 - name: Determine branch name
25 BRANCH="${GITHUB_BASE_REF#refs/heads/}"
26 echo "Building for $BRANCH"
27 echo "BRANCH=$BRANCH" >> $GITHUB_ENV
29 - name: Determine changed packages
33 # only detect packages with changes
34 PKG_ROOTS=$(find . -name Makefile | \
35 grep -v ".*/src/Makefile" | \
36 sed -e 's@./\(.*\)/Makefile@\1/@')
37 CHANGES=$(git diff --diff-filter=d --name-only origin/$BRANCH...)
39 for ROOT in $PKG_ROOTS; do
40 for CHANGE in $CHANGES; do
41 if [[ "$CHANGE" == "$ROOT"* ]]; then
42 if grep -q '$(AUTORELEASE)' "$ROOT/Makefile"; then
43 CONTAINS_AUTORELEASE+="$ROOT"
50 if [ -n "$CONTAINS_AUTORELEASE" ]; then
52 cat > "$GITHUB_WORKSPACE/pr_comment.md" << EOF
53 Please do no longer set *PKG_RELEASE* to *AUTORELEASE* as the
54 feature is deprecated. Please use an integer instead. Below is a
55 list of affected packages including correct *PKG_RELEASE*:
60 for ROOT in $CONTAINS_AUTORELEASE; do
61 echo -n " - ${ROOT}Makefile: PKG_RELEASE:=" >> "$GITHUB_WORKSPACE/pr_comment.md"
62 last_bump="$(git log --pretty=format:'%h %s' "$ROOT" |
63 grep --max-count=1 -e ': [uU]pdate to ' -e ': [bB]ump to ' |
66 if [ -n "$last_bump" ]; then
67 echo -n $(($(git rev-list --count "$last_bump..HEAD" "$ROOT") + 2)) >> "$GITHUB_WORKSPACE/pr_comment.md"
69 echo -n $(($(git rev-list --count HEAD "$ROOT") + 2)) >> "$GITHUB_WORKSPACE/pr_comment.md"
71 echo >> "$GITHUB_WORKSPACE/pr_comment.md"
77 uses: peter-evans/find-comment@v2
81 issue-number: ${{ github.event.pull_request.number }}
82 comment-author: 'github-actions[bot]'
84 - name: Create or update comment
85 uses: peter-evans/create-or-update-comment@v2
88 comment-id: ${{ steps.fc.outputs.comment-id }}
89 issue-number: ${{ github.event.pull_request.number }}
90 body-file: 'pr_comment.md'