Skip to content

Commit cb4f88d

Browse files
authored
Handle empty descriptions (#10)
1 parent 87c87db commit cb4f88d

File tree

6 files changed

+11
-10
lines changed

6 files changed

+11
-10
lines changed

.github/workflows/check-dist.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
runs-on: ubuntu-latest
2222

2323
steps:
24-
- uses: actions/checkout@v2
24+
- uses: actions/checkout@v3
2525

2626
- name: Set Node.js 16.x
2727
uses: actions/setup-node@v3.5.1

.github/workflows/test.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
build:
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@v2
9+
- uses: actions/checkout@v3
1010
- run: |
1111
npm ci
1212
- run: |
@@ -18,9 +18,10 @@ jobs:
1818
- uses: actions/checkout@v3
1919
- uses: ./
2020
with:
21+
github_token: ${{ secrets.GITHUB_TOKEN }}
2122
add_markdown: |
2223
---
2324
# Things!
2425
## Excitement!
25-
[Another link!](https://google.ca)
26-
github_token: ${{ secrets.GITHUB_TOKEN }}
26+
[Links!](https://google.ca)
27+
`Markdown!`

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ jobs:
3030
test:
3131
runs-on: ubuntu-latest
3232
steps:
33-
- uses: actions/checkout@v3
34-
- uses: DerekRoberts/action-pr-description-add
33+
- uses: DerekRoberts/action-pr-description-add@v0.0.1
3534
with:
3635
add_markdown: |
3736
---
3837
# Things!
3938
## Excitement!
40-
[Another link!](https://gov.bc.ca)
39+
[Links!](https://gov.bc.ca)
40+
`Markdown!`
4141
github_token: ${{ secrets.GITHUB_TOKEN }}
4242

4343
```

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ async function action(): Promise<void> {
1515

1616
// API path built from context, current PR description
1717
const apiPath = `/repos/${context.repo.owner}/${context.repo.repo}/pulls/${context.payload.number}`
18-
const description = await (await octokit.request(`GET ${apiPath}`)).data.body
18+
const description = (await octokit.request(`GET ${apiPath}`)).data.body || ''
1919

2020
// Check the description for our markdown message
2121
if (description.includes(markdown)) {

0 commit comments

Comments
 (0)