/js-test-action

JavaScript Test Action

Primary LanguageJavaScriptMIT LicenseMIT

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 Contributors GitHub Repo Size GitHub Top Language GitHub Discussions GitHub Forks GitHub Repo Stars GitHub Org Stars Discord Ko-fi

JavaScript Test Action

JavaScript Test Action Template.

This action creates or updates the provided tag to the sha has that triggered the workflow.

This includes inputs, outputs, job summary, and automatic token authentication.

Inputs

Input Req. Default Value Input Description
tag - test Tag to Create or Update
summary - true Add Summary to Job
token - github.token Only for PAT 1
👀 View Example Job Summary

Updated: test ➡️ 6470ef53102d5229672433f1adb6afa42e7b64d9

Inputs
InputValue
tagtest
summarytrue

With no inputs this will create/update the tag test.

- name: 'JavaScript Test Action'
  uses: smashedr/js-test-action@master

With all inputs.

- name: 'JavaScript Test Action'
  uses: smashedr/js-test-action@master
  with:
    tag: test
    summary: true
    token: ${{ secrets.PAT }} # only include this if you need to use a PAT

Permissions

This action requires the following permissions:

permissions:
  contents: write

Permissions documentation for Workflows and Actions.

Outputs

Output Description
sha Tag Hash
- name: 'JavaScript Test Action'
  id: test
  uses: smashedr/js-test-action@master

- name: 'Echo Output'
  run: |
    echo "sha: '${{ steps.test.outputs.sha }}'"

Examples

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

name: 'Test'

on:
  workflow_dispatch:
  push:

jobs:
  test:
    name: 'Test'
    runs-on: ubuntu-latest
    timeout-minutes: 5
    permissions:
      contents: write

    steps:
      - name: 'Checkout'
        uses: actions/checkout@v4

      - name: 'JavaScript Test Action'
        id: test
        uses: smashedr/js-test-action@master

      - name: 'Echo Outputs'
        run: |
          echo "sha: '${{ steps.test.outputs.sha }}'"

For more examples, you can check out other projects using this action:
https://github.com/smashedr/js-test-action/network/dependents

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.

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

If you would like to submit a PR, please review the CONTRIBUTING.md.

Please consider making a donation to support the development of this project and additional open source projects.

Ko-fi

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

❔ Unpublished Actions

These actions are not published on the Marketplace, but may be useful.


📝 Template Actions

These are basic action templates that I use for creating new actions.

Note: The docker-test-action builds, runs and pushes images to GitHub Container Registry.


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

Development

Development instructions have been moved to the local CONTRIBUTING.md. Additional notes are being added to TEMPLATE.md.

Footnotes

  1. The ${{ github.token }} / {{ secrets.GITHUB_TOKEN }} is automatically passed, there is no need to manually pass these! This is only available to allow users to pass a different token they have created and defined in their secrets.