Skip to content

Add example for resulting comment #21

Add example for resulting comment

Add example for resulting comment #21

Workflow file for this run

name: "Positive Test - regular expression"
on:
pull_request:
types:
- opened
- reopened
- synchronize
- closed
permissions:
pull-requests: write
jobs:
pass:
runs-on: ubuntu-latest
name: Should pass - has regular expression
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Create fake App with console outputs
run: |
touch index.html
cat > index.html << EOF
<!DOCTYPE html>
<html>
<head>
<title>New Page</title>
</head>
<body>
<h1>Hello, World!</h1>
<script>
console.debug('This is a debug message and likely hidden in the pass workflow');
console.info('This is an info in the pass workflow');
console.log('This is a log in the pass workflow');
console.log('This is another log in the pass workflow');
console.warn('This is a warning in the pass workflow');
console.error('This is an error in the pass workflow');
</script>
</body>
</html>
EOF
- name: Upload index.html
uses: actions/upload-artifact@v4
with:
name: index-html
path: index.html
- name: Use WebApp Console Log Action
uses: ./
with:
artifact-name: index-html
comment-tag: pass-regexp
headline: Some messages will be hidden by the regexp
max-log-level: error
regexp-error: 'This is' # This is an error in => an error in (trimmed)
regexp-info: 'This \D+ workflow' # info and log completely hidden
regexp-verbose: 'debug ' # This is a debug message => This is a message
regexp-warning: 'pass ' # in the pass workflow => in the workflow
wait-time: 5
webapp-url: 'http://localhost'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}