Skip to content

wesleyscholl/github-action-base-ts

Repository files navigation

github-action-base-ts

A Typescript GitHub Action Starter Repo 🚀▶️

Tests GitHub Workflow Status (with event) GitHub Release Date - Published_At coverage badge GitHub Marketplace GitHub package.json dynamic Dynamic YAML Badge Code Style: prettier Code Linter: ESLint GitHub top language GitHub contributors GitHub Discussions GitHub Release (with filter) GitHub code size in bytes GitHub repo size GitHub package.json dynamic MIT

About

GitHub Action Description.

Usage

In your workflow, to use this github action add a step like this to your workflow:

- name: Run github-action
  uses: wesleyscholl/github-action@v1.0.0
  id: github-action
  with:
   GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" # Required/optional - Description
   input1: "string" # Required/optional - Description
   input2: 10 # Required/optional - Description        
       

Subscribing to GitHub events to kick off GitHub action workflows:

on: 
  discussion: 
    types: [created] 

Requirements

Description about requirements to run this GitHub Action.

Configure:

  • Option 1

  • Option 2

  • Option 3

  • More detailed configuration step.

Inputs

Name Description Requried? Default
GITHUB_TOKEN Ensure you create a PAT with discussion: write and repo: write, then add it as an github action secret in your repo. No ${{ secrets.GITHUB_TOKEN }}
comment_body The contents of the autoresponder comment in string format. No "This comment was generated by the Discussion Autoresponder GitHub Action."

Outputs

Name Description How To Access
ghaVar1 Description about output1. ${{ steps.<your-step>.outputs.variable1}}
ghaVar1 Description about output2. ${{ steps.<your-step>.outputs.variable2 }}

Accessing Outputs

- name: Show Outputs
  run: |
    echo "variable1 = ${{ steps.<your-step>.outputs.variable1 }}"
    echo "variable2 = ${{ steps.<your-step>.outputs.variable2 }}"

Example

Example workflow

Configuration

*If you fork this repository, ensure you enable workflows in the workflows tab.

Credits

Inspired by: