Skip to content

cssnr/check-build-action

Repository files navigation

GitHub Tag Major GitHub Tag Minor GitHub Release Version GitHub Dist Size Workflow Release Workflow Test Workflow lint Quality Gate Status GitHub Last Commit Codeberg Last Commit GitHub Top Language GitHub Forks GitHub Repo Stars GitHub Org Stars Discord

Check Build Action

This action is designed to check if a build has been run. It works on any event.

On a pull_request it will add a comment with a message mentioning the user.

All options are configurable.

Inputs

Input Req. Default Value Input Description
build - npm run build Build Command to Run *
check - git diff --quiet dist Check Command to Run *
path - - Path to Verify Exist *
comment - true Add Comment to PR *
message - see below Message for Comment *
mention - true Mention Actor with @ *
summary - true Add Workflow Job Summary *
token - github.token For use with a PAT

build: Build or prepare command to run before checking if build was run.

check: Check command to run to verify build was run. This should exit with error on failure.

path: A path to verify exists, otherwise will fail.

comment: Add a comment to the pull request.

message: Message to put in comment. Default:

Run: `run npm build`

mention: Will mention the actor in the comment with @user.

summary: Will add result details to the job summary on the workflow run.

👀 View Example Job Summary

Coming Soon...


- name: 'Check Build Action'
  uses: cssnr/check-build-action@master

Permissions

This action requires the following permissions to add pull request comments:

permissions:
  pull-requests: write

Permissions documentation for Workflows and Actions.

Outputs

Output Output Description
id Comment ID if Added
error Error Message if Any

This outputs the changes json object and the markdown table.

- name: 'Check Build Action'
  id: outdated
  uses: cssnr/check-build-action@master

- name: 'Echo Output'
  env:
    ERROR: ${{ steps.outdated.outputs.error }}
  run: |
    echo "id: ${{ steps.outdated.outputs.id }}"
    echo "error: ${ERROR}"

Note: due to the way ${{}} expressions are evaluated, multi-line output gets executed in a run block.

More Output Examples Coming Soon...

Examples

💡 Click on an example heading to expand or collapse the example.

Custom Build and Check Command
- name: 'Check Build Action'
  uses: cssnr/check-build-action@master
  with:
    build: 'npm run build'
    check: 'git diff --quiet dist'
With All Inputs
- name: 'Check Build Action'
  uses: cssnr/check-build-action@master
  with:
    build: 'npm run build'
    check: 'git diff --quiet dist'
    path: ''
    comment: 'true'
    message: 'Run: `npm run build`'
    mention: 'true'
    summary: 'true'

More Examples Coming Soon...

Tags

The following rolling tags are maintained.

Version Tag Rolling Bugs Feat. Name Target Example
GitHub Tag Major Major vN.x.x vN
GitHub Tag Minor Minor vN.N.x vN.N
GitHub Release Micro vN.N.N vN.N.N

You can view the release notes for each version on the releases page.

The Major tag is recommended. It is the most up-to-date and always backwards compatible. Breaking changes would result in a Major version bump. At a minimum you should use a Minor tag.

Features

  • Custom build command
  • Custom check command
  • Optional path to verify
  • Option to comment on PRs
  • Option to customize message and mention

Planned

Want to automatically updated tags on release? Check out: cssnr/update-version-tags-action
Want to check outdated packages on a PR? Check out: cssnr/npm-outdated-action
Want to show package changes on release notes? Check out: cssnr/package-changelog-action

Support

For general help or to request a feature, see:

If you are experiencing an issue/bug or getting unexpected results, you can:

For more information, see the CSSNR SUPPORT.md.

Contributing

Currently, the best way to contribute to this project is to star this project on GitHub.

For more information, see the CSSNR CONTRIBUTING.md.

Additionally, you can support other GitHub Actions I have published:

For a full list of current projects to support visit: https://cssnr.github.io/

Releases

No releases published