Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions workflow-templates/first-merged-pr-comment.properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "First merged PR comment",
"description": "Comment on a contributor's first merged pull request with a repository-defined message template.",
"iconName": "octicon comment",
"categories": [
"Code Review"
]
}
55 changes: 55 additions & 0 deletions workflow-templates/first-merged-pr-comment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# SPDX-FileCopyrightText: 2026 LibreCode coop and contributors
# SPDX-License-Identifier: AGPL-3.0-or-later

name: First merged PR comment

on:
pull_request_target:
types: [closed]
workflow_dispatch:
inputs:
pull_request_number:
description: Pull request number to process or retry
required: true
type: string

permissions: {}

concurrency:
group: >-
first-merged-pr-comment-${{
github.event.pull_request.number ||
inputs.pull_request_number ||
github.run_id
}}
cancel-in-progress: false

jobs:
first-merged-pr-comment:
if: >-
github.event_name == 'workflow_dispatch' ||
(
github.event.pull_request.merged == true &&
github.event.pull_request.user.type != 'Bot'
)
runs-on: ubuntu-latest
timeout-minutes: 5

permissions:
pull-requests: write

env:
FIRST_MERGED_PR_MESSAGE: >-
${{ vars.FIRST_MERGED_PR_MESSAGE ||
'Thanks {contributor_mention}! Your first pull request to {repository_name} has been merged.' }}

steps:
# pull_request_target is intentionally used without checkout. Nothing
# from the pull request head is downloaded or executed.
- name: Comment on first merged pull request
uses: LibreCodeCoop/github-workflows/actions/first-merged-pr-comment@6816f216b2b04d5dd63d01711f88c5ff1d1e0740
with:
github-token: ${{ github.token }}
pull-request-number: >-
${{ github.event.pull_request.number || inputs.pull_request_number }}
message-template: ${{ env.FIRST_MERGED_PR_MESSAGE }}
30 changes: 23 additions & 7 deletions workflow-templates/nightly-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ on:

permissions:
contents: write
pull-requests: read

concurrency:
group: nightly-release-${{ github.repository }}-${{ github.ref_name }}
Expand Down Expand Up @@ -236,18 +237,33 @@ jobs:
gh api --method POST "repos/${GITHUB_REPOSITORY}/git/refs" -f ref='refs/tags/nightly' -f sha="${GITHUB_SHA}" >/dev/null
fi

- name: Resolve nightly release note range
id: release-note-range
working-directory: ${{ env.APP_NAME }}
shell: bash
run: |
last_tag="$(git tag --list --sort=-version:refname | grep -v '^nightly$' | head -1 || true)"
echo "from-ref=${last_tag}" >> "${GITHUB_OUTPUT}"

- name: Build nightly change list
id: release-note-changes
uses: LibreCodeCoop/github-workflows/actions/release-notes-from-pull-requests@db491a51227ff4fd76b35b7a24ab7718aab6cbee
with:
github-token: ${{ github.token }}
repository: ${{ github.repository }}
branch: ${{ steps.nightly.outputs.branch }}
working-directory: ${{ env.APP_NAME }}
from-ref: ${{ steps.release-note-range.outputs.from-ref }}
to-ref: HEAD
fallback-limit: '10'

- name: Build nightly release notes
working-directory: ${{ env.APP_NAME }}
shell: bash
env:
NIGHTLY_BRANCH: ${{ steps.nightly.outputs.branch }}
CHANGES_FILE: ${{ steps.release-note-changes.outputs.changes-file }}
run: |
last_tag="$(git tag --list --sort=-version:refname | grep -v '^nightly$' | head -1 || true)"
if [ -n "${last_tag}" ]; then
commits="$(git log "${last_tag}..HEAD" --pretty=format:'- %s (%h)' --no-merges)"
else
commits="$(git log -10 --pretty=format:'- %s (%h)' --no-merges)"
fi
{
echo "## 🌙 Nightly Build - ${APP_VERSION}"
echo
Expand All @@ -257,7 +273,7 @@ jobs:
echo
echo "### Recent Changes"
echo
printf '%s\n' "${commits}"
cat "${CHANGES_FILE}"
echo
echo "---"
printf 'Generated from commit `%s`.\n' "${GITHUB_SHA:0:7}"
Expand Down
Loading