Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Socket
Sign inDemoInstall

github-script-action

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github-script-action

GitHub Action for running inline JavaScript snippets


Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

script-action

An alternative to the official github-script action, with some additional features.

Usage

See action.yml.

- uses: silverlyra/script-action@v0.2
  with:
    # JavaScript source to run (or a script filename)
    script: >
      console.log("Hello, world!");

    # Input data to pass into your script
    input: 'null'

    # If "json", `input` will be parsed as JSON.
    # If "string", your script will see the literal string value of `input`.
    input-encoding: 'json'

    # If "json", the script's return value will be JSON-encoded.
    # If "string", the script's return value will be output as a string.
    result-encoding: 'json'

    # Directory to change into
    cwd: '.'

    github-token: ${{ github.token }}

Script

The JavaScript passed as the script input will have the following values predefined:

  • input: The input passed to the action, via with:
  • env: An object containing all environment variables (process.env)

Scripts also have access to some helper functions:

  • fetch: The fetch function
  • readEvent: Read the GitHub event JSON file off of disk; return the event name and its data
  • shell: Spawn a process and (optionally) capture its output

These packages are also available:

  • fs: The Node.js fs/promises module
  • path: The Node.js path module
  • artifact: The @actions/artifact NPM package
  • chalk: The chalk NPM package
  • core: The @actions/core NPM package
  • exec: The @actions/exec NPM package
  • glob: The @actions/glob NPM package
  • io: The @actions/io NPM package

Keywords

FAQs

Package last updated on 28 May 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc