Skip to content

Commit ee1b38b

Browse files
Fix escaping of PR title/body
1 parent 91ad242 commit ee1b38b

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

.github/workflows/fabbot.yml

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,15 @@ jobs:
2020
runs-on: ubuntu-24.04
2121
steps:
2222
- name: Checkout code
23+
env:
24+
PR_NUMBER: ${{ github.event.pull_request.number }}
25+
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
26+
REPO_OWNER: ${{ github.repository_owner }}
27+
REPO_NAME: ${{ github.event.repository.name }}
2328
run: |
2429
# Checkout patched files using the REST API and install dependencies concurrently
25-
PR_NUMBER="${{ github.event.pull_request.number }}"
26-
PR_HEAD_SHA="${{ github.event.pull_request.head.sha }}"
27-
REPO_OWNER="${{ github.repository_owner }}"
28-
REPO_NAME="${{ github.event.repository.name }}"
29-
3030
pip install codespell &
3131
composer global require -q friendsofphp/php-cs-fixer seld/jsonlint symfony/yaml &
32-
3332
mkdir a
3433
3534
gh api -H "Accept: application/vnd.github.v3.raw" \
@@ -86,10 +85,14 @@ jobs:
8685
8786
- name: Check for merge commits
8887
if: always()
88+
env:
89+
PR_NUMBER: ${{ github.event.pull_request.number }}
90+
REPO_OWNER: ${{ github.repository_owner }}
91+
REPO_NAME: ${{ github.event.repository.name }}
8992
run: |
9093
# If a PR contains merge commits, fail the job
9194
gh api -H "Accept: application/vnd.github.v3+json" \
92-
"/repos/${{ github.repository_owner }}/${{ github.event.repository.name }}/pulls/${{ github.event.pull_request.number }}/commits" \
95+
"/repos/$REPO_OWNER/$REPO_NAME/pulls/$PR_NUMBER/commits" \
9396
| jq -r '.[].parents | length > 1' | grep true > /dev/null && {
9497
echo "::error::Merge commits are not allowed in pull requests."
9598
echo "Please rebase your branch."
@@ -138,11 +141,11 @@ jobs:
138141
139142
- name: Check PR header
140143
if: always()
144+
env:
145+
PR_TITLE: ${{ github.event.pull_request.title }}
146+
PR_BODY: ${{ github.event.pull_request.body }}
141147
run: |
142148
# Check if the PR title and body follow the Symfony contribution guidelines
143-
PR_TITLE="${{ github.event.pull_request.title }}"
144-
PR_BODY="${{ github.event.pull_request.body }}"
145-
146149
if [[ "${{ inputs.check_license }}" == "true" ]]; then
147150
if [[ ! "$PR_BODY" =~ \|\ License[\ ]+\|\ MIT ]]; then
148151
echo "::error::You must add the standard contribution header in the PR description"

0 commit comments

Comments
 (0)