Skip to content
Merged
Changes from 2 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
4e0ff1f
ci: replace marocchino/sticky-pull-request-comment by gh cli
rjaegers Oct 6, 2025
c386164
ci: update comments
rjaegers Oct 6, 2025
4a13d40
ci: remove social-interaction workflow
rjaegers Oct 6, 2025
dba12f6
Update .github/workflows/pr-conventional-title.yml
rjaegers Oct 6, 2025
ef6036e
chore: fix issues identified in workflow
rjaegers Oct 6, 2025
880c891
ci: refactor to re-usable workflow
rjaegers Oct 6, 2025
0bc63b6
chore: process more review feedback
rjaegers Oct 6, 2025
0fdad3a
style: add yaml start token
rjaegers Oct 6, 2025
642f0af
chore: apply review comments
rjaegers Oct 6, 2025
81a4527
chore: add checkout action
rjaegers Oct 6, 2025
0d64ddf
chore: restore after failed experiment
rjaegers Oct 6, 2025
a99e6e6
chore: remove more fall-out
rjaegers Oct 6, 2025
dcf4ad4
ci: least privilege and add documentation
rjaegers Oct 6, 2025
61945f8
ci: fix out of date version comment
rjaegers Oct 6, 2025
bebaa47
ci: fix more zizmor findings
rjaegers Oct 6, 2025
615187b
chore: fix more zizmor findings
rjaegers Oct 10, 2025
a24c3e1
Merge commit 'c95553700f0bc0441f25acb4268840fbd6e2733c' into ci/harde…
rjaegers Oct 22, 2025
8e5a5dd
Apply suggestion from @Copilot
rjaegers Oct 22, 2025
f0fbc35
ci: add cooldown to dependabot
rjaegers Oct 22, 2025
262644d
ci: document permissions
rjaegers Oct 22, 2025
457b2c0
Merge branch 'main' into ci/harden-action-security
rjaegers Oct 24, 2025
89ed11d
chore: fix more findings
rjaegers Oct 24, 2025
e098064
chore: document all permissions
rjaegers Oct 27, 2025
87e46a6
chore: fix template injection possibility
rjaegers Oct 27, 2025
3e271c9
Merge branch 'main' into ci/harden-action-security
rjaegers Oct 27, 2025
b387a42
Merge branch 'main' into ci/harden-action-security
rjaegers Oct 27, 2025
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
51 changes: 38 additions & 13 deletions .github/workflows/pr-conventional-title.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
validate-pr-title:
runs-on: ubuntu-latest
permissions:
# We need `pull-requests: write` to be able to post comments on PRs
pull-requests: write
steps:
- uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
Expand All @@ -32,21 +33,45 @@ jobs:
doesn't start with an uppercase character.
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: marocchino/sticky-pull-request-comment@773744901bac0e8cbb5a0dc842800d45e9b2b405 # v2.9.4
- name: Add a PR comment with semantic title suggestions
if: always() && steps.pr-title.outputs.error_message != null
with:
header: pr-title-lint-error
message: |
Hey there and thank you for opening this pull request! 👋🏼
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
run: |
set -Eeuo pipefail

We require pull request titles to follow the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/) and it looks like your proposed title needs to be adjusted.
MARKER="<!-- pr-title-lint-error -->"
BODY_HEADER="Hey there and thank you for opening this pull request! 👋🏼\n\nWe require pull request titles to follow the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/) and it looks like your proposed title needs to be adjusted.\n\n:warning: Details\n\n${{ steps.pr-title.outputs.error_message }}"
FULL_BODY="$MARKER\n\n$BODY_HEADER"
EXISTING_ID=$(gh api repos/${GITHUB_REPOSITORY}/issues/${PR_NUMBER}/comments --jq \
".[] | select(.body|contains(\"$MARKER\")) | .id" | head -n1 || true)

:warning: Details
if [ -n "${EXISTING_ID}" ]; then
echo "Updating existing sticky comment (${EXISTING_ID})"
gh api repos/${GITHUB_REPOSITORY}/issues/comments/${EXISTING_ID} -X PATCH -f body="${FULL_BODY}"
else
echo "Creating new sticky comment"
gh api repos/${GITHUB_REPOSITORY}/issues/${PR_NUMBER}/comments -f body="${FULL_BODY}"
fi
- name: Remove PR comment
if: steps.pr-title.outputs.error_message == null
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
run: |
set -Eeuo pipefail

${{ steps.pr-title.outputs.error_message }}
MARKER="<!-- pr-title-lint-error -->"
IDS=$(gh api repos/${GITHUB_REPOSITORY}/issues/${PR_NUMBER}/comments --jq \
".[] | select(.body|contains(\"$MARKER\")) | .id" || true)

- if: steps.pr-title.outputs.error_message == null
uses: marocchino/sticky-pull-request-comment@773744901bac0e8cbb5a0dc842800d45e9b2b405 # v2.9.4
with:
header: pr-title-lint-error
delete: true
if [ -z "${IDS}" ]; then
echo "No sticky comment to remove."
exit 0
fi

for id in $IDS; do
echo "Deleting sticky comment $id"
gh api repos/${GITHUB_REPOSITORY}/issues/comments/${id} -X DELETE
done
Loading