Skip to content

Commit 981d652

Browse files
committed
Add example GitHub action
1 parent 2e87beb commit 981d652

File tree

4 files changed

+43
-0
lines changed

4 files changed

+43
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: Task Checklist
2+
inputs:
3+
content:
4+
description: 'Content of the PR description'
5+
required: true
6+
default: ''
7+
runs:
8+
using: 'node20'
9+
main: 'index.js'
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
const core = require('@actions/core');
2+
const github = require('@actions/github');
3+
4+
try {
5+
const body = github.context.payload.pull_request?.body;
6+
console.log(body);
7+
// Fetch the value of the input 'who-to-greet' specified in action.yml
8+
const nameToGreet = core.getInput('who-to-greet');
9+
console.log(`Hello ${nameToGreet}!`);
10+
} catch (error) {
11+
// Handle errors and indicate failure
12+
core.setFailed(error.message);
13+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"name": "task-checklist",
3+
"private": "true",
4+
"version": "1.0.0",
5+
"main": "index.js",
6+
"license": "Apache-2.0"
7+
}

.github/workflows/task-checklist.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Run task checklist
2+
3+
on:
4+
check_run:
5+
pull_request:
6+
types: [opened, synchronize, edited, reopened]
7+
8+
jobs:
9+
task-checklist:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: ./.github/actions/task-checklist/action.yml
13+
with:
14+
repo-token: '${{ secrets.GITHUB_TOKEN }}'

0 commit comments

Comments
 (0)