Skip to content
Latchkey

New issue greeting workflow (trailheadapps/lwc-recipes)

The New issue greeting workflow from trailheadapps/lwc-recipes, explained and optimized by Latchkey.

A

CI health: A - excellent

Run this on Latchkey for self-healing, caching, and up to 58% lower cost.

Grade your own workflow free or run it on Latchkey →
Source: trailheadapps/lwc-recipes.github/workflows/new-issue-welcome.ymlLicense CC0-1.0View source

What it does

This is the New issue greeting workflow from the trailheadapps/lwc-recipes repository, a real project running GitHub Actions. It is shown here with attribution under its CC0-1.0 license.

Below, Latchkey shows a faster, safer version produced by its optimization engine.

The workflow

workflow (.yml)
name: New issue greeting

on:
    issues:
        types: [opened]

jobs:
    comment:
        runs-on: trailheadapps-Ubuntu
        steps:
            - uses: actions/github-script@v6
              with:
                  script: |
                      await github.rest.issues.createComment({
                        issue_number: context.issue.number,
                        owner: context.repo.owner,
                        repo: context.repo.repo,
                        body: 'Thank you for posting this issue. πŸ™‡πŸΌβ€β™‚οΈ<br/>We will come back to you shortly.'
                      })

The same workflow, on Latchkey

Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.

name: New issue greeting
 
on:
    issues:
        types: [opened]
 
jobs:
    comment:
        timeout-minutes: 30
        runs-on: trailheadapps-Ubuntu
        steps:
            - uses: actions/github-script@v6
              with:
                  script: |
                      await github.rest.issues.createComment({
                        issue_number: context.issue.number,
                        owner: context.repo.owner,
                        repo: context.repo.repo,
                        body: 'Thank you for posting this issue. πŸ™‡πŸΌβ€β™‚οΈ<br/>We will come back to you shortly.'
                      })
 

What changed

This workflow runs 1 job per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.

Actions used in this workflow