Skip to content

Commit 3ed30d9

Browse files
committed
test posting message
1 parent 64916d9 commit 3ed30d9

File tree

1 file changed

+52
-2
lines changed

1 file changed

+52
-2
lines changed

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

Lines changed: 52 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,13 @@ 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 --config-set ignore_warnings_on_exit 1
202+
vendor/bin/phpcs --config-set ignore_errors_on_exit 1
203+
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 $MODULE_FOLDER >> styling_report.txt
204+
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 $MODULE_FOLDER >> styling_report.txt
205+
PHPCS_REPORT=`cat styling_report.txt`
206+
echo "PHPCS_REPORT=$PHPCS_REPORT" >> $GITHUB_ENV
207+
echo "### Hello world! :rocket:" >> $GITHUB_STEP_SUMMARY
203208
204209
- name: Run Drupal-Check
205210
working-directory: ${{ env.DRUPAL_ROOT }}
@@ -247,3 +252,48 @@ jobs:
247252
continue-on-error: true
248253
run: |
249254
vendor/bin/phpunit --bootstrap $DRUPAL_ROOT/core/tests/bootstrap.php -c $MODULE_FOLDER/phpunit.xml $MODULE_FOLDER
255+
256+
257+
- name: Test Summary
258+
working-directory: ${{ env.DRUPAL_ROOT }}
259+
continue-on-error: true
260+
run: |
261+
echo "### Hello world2! :rocket: :rocket:" >> $GITHUB_STEP_SUMMARY
262+
263+
264+
- uses: actions/github-script@v6
265+
id: get_issue_number
266+
with:
267+
script: |
268+
if (context.issue.number) {
269+
// Return issue number if present
270+
return context.issue.number;
271+
} else {
272+
// Otherwise return issue number from commit
273+
return (
274+
await github.rest.repos.listPullRequestsAssociatedWithCommit({
275+
commit_sha: context.sha,
276+
owner: context.repo.owner,
277+
repo: context.repo.repo,
278+
})
279+
).data[0].number;
280+
}
281+
result-encoding: string
282+
283+
- uses: actions/github-script@v6
284+
env:
285+
prn: ${{ steps.get_issue_number.outputs.result }}
286+
PHPCS_REPORT: ${{ env.PHPCS_REPORT }}
287+
with:
288+
script: |
289+
console.log(context)
290+
console.log(process.env)
291+
292+
const { prn, PHPCS_REPORT } = process.env
293+
294+
github.rest.issues.createComment({
295+
issue_number: 35,
296+
owner: context.repo.owner,
297+
repo: context.repo.repo,
298+
body: 'hello world'
299+
})

0 commit comments

Comments
 (0)