Skip to content

Commit 2a246b9

Browse files
committed
test posting message
1 parent 64916d9 commit 2a246b9

File tree

1 file changed

+38
-2
lines changed

1 file changed

+38
-2
lines changed

.github/workflows/drupal-tests-and-standards.yml

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,10 @@ jobs:
198198
working-directory: ${{ env.DRUPAL_ROOT }}
199199
continue-on-error: true
200200
run: |
201-
vendor/bin/phpcs -s --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,css,info,txt --ignore=node_modules,bower_components,vendor,dist --exclude=Drupal.InfoFiles.AutoAddedKeys --colors $MODULE_FOLDER
202-
vendor/bin/phpcs -s --standard=DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt --ignore=node_modules,bower_components,vendor,dist --exclude=Drupal.InfoFiles.AutoAddedKeys --colors $MODULE_FOLDER
201+
vendor/bin/phpcs -s --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,css,info,txt --ignore=node_modules,bower_components,vendor,dist --exclude=Drupal.InfoFiles.AutoAddedKeys --colors $MODULE_FOLDER >> styling_report.txt
202+
vendor/bin/phpcs -s --standard=DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt --ignore=node_modules,bower_components,vendor,dist --exclude=Drupal.InfoFiles.AutoAddedKeys --colors $MODULE_FOLDER >> styling_report.txt
203+
value=`cat styling_report.txt`
204+
echo "phpcsReport=${value}" >> "$GITHUB_OUTPUT"
203205
204206
- name: Run Drupal-Check
205207
working-directory: ${{ env.DRUPAL_ROOT }}
@@ -247,3 +249,37 @@ jobs:
247249
continue-on-error: true
248250
run: |
249251
vendor/bin/phpunit --bootstrap $DRUPAL_ROOT/core/tests/bootstrap.php -c $MODULE_FOLDER/phpunit.xml $MODULE_FOLDER
252+
253+
254+
255+
256+
- uses: actions/github-script@v6
257+
id: get_issue_number
258+
with:
259+
script: |
260+
if (context.issue.number) {
261+
// Return issue number if present
262+
return context.issue.number;
263+
} else {
264+
// Otherwise return issue number from commit
265+
return (
266+
await github.rest.repos.listPullRequestsAssociatedWithCommit({
267+
commit_sha: context.sha,
268+
owner: context.repo.owner,
269+
repo: context.repo.repo,
270+
})
271+
).data[0].number;
272+
}
273+
result-encoding: string
274+
275+
- uses: actions/github-script@v6
276+
with:
277+
script: |
278+
console.log(context)
279+
console.log("$phpcsReport")
280+
github.rest.issues.createComment({
281+
issue_number: steps.get_issue_number.outputs.result,
282+
owner: context.repo.owner,
283+
repo: context.repo.repo,
284+
body: '"$phpcsReport"'
285+
})

0 commit comments

Comments
 (0)