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 →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
- Add a job timeout so a hung step cannot burn hours of runner time.
This workflow runs 1 job per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.