3
3
on :
4
4
push :
5
5
pull_request :
6
+ pull_request_target :
7
+ types : [opened, reopened, synchronize]
6
8
7
9
concurrency :
8
10
group : ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
14
16
15
17
jobs :
16
18
commitlint :
17
- if : github.event_name == 'pull_request'
18
- env :
19
- GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
19
+ if : github.event_name == 'pull_request_target'
20
20
runs-on : ubuntu-latest
21
21
steps :
22
22
- uses : actions/checkout@v4
23
23
with :
24
24
fetch-depth : 0
25
25
- name : Run commitlint
26
26
run : |
27
- commit=$(gh api \
28
- /repos/ ${{ github.repository }}/pulls/${{github. event.number}}/commits \
29
- | jq -r '.[0].commit.message' \
30
- | head -n 1 )
27
+ base_sha="${{ github.event.pull_request.base.sha }}"
28
+ head_sha=" ${{ github.event.pull_request.head.sha }}"
29
+ first_commit_sha=$(git rev-list --no-merges --reverse $base_sha..$head_sha | head -n 1)
30
+ commit_message=$(git log -1 --pretty=%B $first_commit_sha )
31
31
# we can't use npx see https://github.com/conventional-changelog/commitlint/issues/613
32
32
echo '{}' > package.json
33
33
npm install --no-fund --no-audit @commitlint/config-conventional @commitlint/cli
34
- echo $commit | ./node_modules/.bin/commitlint -g .commitlintrc
34
+ echo "$commit_message" | ./node_modules/.bin/commitlint -g .commitlintrc
35
35
36
36
architecture :
37
37
name : Check components interdependencies
@@ -1088,15 +1088,16 @@ jobs:
1088
1088
ini-values : memory_limit=-1
1089
1089
# Not in pecl
1090
1090
- name : Setup mongodb
1091
+ shell : bash
1091
1092
run : |
1092
1093
curl -sLO https://github.com/mongodb/mongo-php-driver/releases/download/1.17.2/php_mongodb-1.17.2-8.3-nts-x64.zip
1093
1094
unzip -q php_mongodb-1.17.2-8.3-nts-x64.zip php_mongodb.dll
1094
- mv php_mongodb.dll C:\ tools\ php\ ext
1095
- echo "extension=php_mongodb.dll" >> C:\ tools\ php\ php.ini
1095
+ mv php_mongodb.dll C:/ tools/ php/ ext
1096
+ echo "extension=php_mongodb.dll" >> C:/ tools/ php/ php.ini
1096
1097
- name : Get composer cache directory
1097
1098
id : composercache
1098
- run : echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
1099
1099
shell : bash
1100
+ run : echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
1100
1101
- name : Cache dependencies
1101
1102
uses : actions/cache@v4
1102
1103
with :
@@ -1105,18 +1106,21 @@ jobs:
1105
1106
restore-keys : ${{ runner.os }}-composer-
1106
1107
- name : Keep windows path
1107
1108
id : get-cwd
1109
+ shell : bash
1108
1110
run : |
1109
1111
cwd=$(php -r 'echo(str_replace("\\", "\\\\", $_SERVER["argv"][1]));' '${{ github.workspace }}')
1110
1112
echo cwd=$cwd >> $GITHUB_OUTPUT
1111
- shell : bash
1112
1113
- name : Update project dependencies
1114
+ shell : bash
1113
1115
run : |
1114
1116
composer global require soyuka/pmu
1115
1117
composer global config allow-plugins.soyuka/pmu true --no-interaction
1116
1118
composer global link . --working-directory='${{ steps.get-cwd.outputs.cwd }}'
1117
1119
- name : Clear test app cache
1120
+ shell : bash
1118
1121
run : tests/Fixtures/app/console cache:clear --ansi
1119
1122
- name : Run Behat tests
1123
+ shell : bash
1120
1124
run : vendor/bin/behat --out=std --format=progress --profile=default --no-interaction
1121
1125
1122
1126
phpunit-symfony-lowest :
0 commit comments