@@ -20,16 +20,15 @@ jobs:
20
20
runs-on : ubuntu-24.04
21
21
steps :
22
22
- 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 }}
23
28
run : |
24
29
# 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
-
30
30
pip install codespell &
31
31
composer global require -q friendsofphp/php-cs-fixer seld/jsonlint symfony/yaml &
32
-
33
32
mkdir a
34
33
35
34
gh api -H "Accept: application/vnd.github.v3.raw" \
@@ -86,10 +85,14 @@ jobs:
86
85
87
86
- name : Check for merge commits
88
87
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 }}
89
92
run : |
90
93
# If a PR contains merge commits, fail the job
91
94
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" \
93
96
| jq -r '.[].parents | length > 1' | grep true > /dev/null && {
94
97
echo "::error::Merge commits are not allowed in pull requests."
95
98
echo "Please rebase your branch."
@@ -138,11 +141,11 @@ jobs:
138
141
139
142
- name : Check PR header
140
143
if : always()
144
+ env :
145
+ PR_TITLE : ${{ github.event.pull_request.title }}
146
+ PR_BODY : ${{ github.event.pull_request.body }}
141
147
run : |
142
148
# 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
-
146
149
if [[ "${{ inputs.check_license }}" == "true" ]]; then
147
150
if [[ ! "$PR_BODY" =~ \|\ License[\ ]+\|\ MIT ]]; then
148
151
echo "::error::You must add the standard contribution header in the PR description"
0 commit comments