Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Create Github PR annotations from report files e.g. junit

License

NotificationsYou must be signed in to change notification settings

granodigital/report-annotate

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub Super-LinterCICheck dist/CodeQLCoverage

Easily add annotations to your GitHub pull requests based on reports from yourtests, linters, etc.

Usage Example

steps:  -name:Checkoutid:checkoutuses:actions/checkout@v4  -name:Run Tests & Lint etc.run:npm install && npm run test:lint:etc  -name:Report Annotateid:annotateif:always()# Run with test/lint failures.uses:granodigital/report-annotate@v1with:reports:|        junit|reports/junit-generic.xml        junit-eslint|reports/*-eslint.xml        junit-jest|reports/junit-jest.xmlmax-annotations:20# Keep the clutter down (50 is max by GitHub)ignore:node_modules/**,dist/**# Ignore patterns for the report search (default).   -name:Annotations createdif:always()run:|         echo "Total: ${{ steps.annotate.outputs.total }}"         echo "Errors: ${{ steps.annotate.outputs.errors }}"         echo "Warnings: ${{ steps.annotate.outputs.warnings }}"         echo "Notices: ${{ steps.annotate.outputs.notices }}"

Note

You'll need to have a reasonably modern version ofNode.js handy (20.x or later should work!). If you areusing a version manager likenodenv orfnm, this template has a.node-versionfile at the root of the repository that can be used to automatically switch tothe correct version when youcd into the repository. Additionally, this.node-version file is used by GitHub Actions in anyactions/setup-nodeactions.

Custom Matchers

You can define custom matchers to parse your reports and create annotations.Currently only XML reports are supported using XPath selectors.

Feel free to open a PR to add support for new report formats or matchers.

See matchers folder for examples.

----name:Report Annotateid:annotateif:always()# Run with test/lint failures.uses:granodigital/report-annotate@v1with:reports:my-matcher|reports/*.xmlcustom-matchers:|      {       "my-matcher": {          "format": "xml",          "item": "//testCase",          "title": "oopsie-daisy/@message",          "message": "oopsie-daisy/text()",          "file": "parent::testFile/@filePath",          "startLine": "oopsie-daisy/@line"        }      }

Development

  1. Install the dependencies

    npm install
  2. 🏗️ Package the TypeScript for distribution

    npm run bundle
  3. ✅ Run the tests

    $ npmtestPASS  ./index.test.js  ✓ throws invalid number (3ms)  ✓wait 500 ms (504ms)  ✓test runs (95ms)...

Update the Action Metadata

Theaction.yml file defines metadata about your action, such asinput(s) and output(s). For details about this file, seeMetadata syntax for GitHub Actions.

When you copy this repository, updateaction.yml with the name, description,inputs, and outputs for your action.

Update the Action Code

Thesrc/ directory is the heart of your action! This contains thesource code that will be run when your action is invoked. You can replace thecontents of this directory with your own code.

There are a few things to keep in mind when writing your action code:

  1. Create a new branch

    git checkout -b releases/v1
  2. Replace the contents ofsrc/ with your action code

  3. Add tests to__tests__/ for your source code

  4. Format, test, and build the action

    npm run all

For information about versioning your action, seeVersioningin the GitHub Actions toolkit.

Publishing a New Release

This project includes a helper script,script/releasedesigned to streamline the process of tagging and pushing new releases forGitHub Actions.

GitHub Actions allows users to select a specific version of the action to use,based on release tags. This script simplifies this process by performing thefollowing steps:

  1. Retrieving the latest release tag: The script starts by fetching the mostrecent SemVer release tag of the current branch, by looking at the local dataavailable in your repository.
  2. Prompting for a new release tag: The user is then prompted to enter a newrelease tag. To assist with this, the script displays the tag retrieved inthe previous step, and validates the format of the inputted tag (vX.X.X). Theuser is also reminded to update the version field in package.json.
  3. Tagging the new release: The script then tags a new release and syncs theseparate major tag (e.g. v1, v2) with the new release tag (e.g. v1.0.0,v2.1.2). When the user is creating a new major release, the scriptauto-detects this and creates areleases/v# branch for the previous majorversion.
  4. Pushing changes to remote: Finally, the script pushes the necessarycommits, tags and branches to the remote repository. From here, you will needto create a new release in GitHub so users can easily reference the new tagsin their workflows.

About

Create Github PR annotations from report files e.g. junit

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript77.2%
  • Shell14.0%
  • JavaScript8.8%

[8]ページ先頭

©2009-2025 Movatter.jp