Skip to content

Commit 9f059ec

Browse files
committed
chore!: deprecate limit_to_pr_opened param
1 parent 21026c0 commit 9f059ec

File tree

4 files changed

+5
-17
lines changed

4 files changed

+5
-17
lines changed

.github/workflows/pr-open.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ jobs:
3232
# Test with different inputs
3333
- uses: ./
3434
with:
35-
limit_to_pr_opened: true
3635
add_markdown: |
3736
---
3837

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ This action adds to Pull Request descriptions using markdown. It checks if the
2222

2323
`github_token`: ${{ secrets.GITHUB_TOKEN }} or a Personal Access Token (PAT). Default is to inherit a token from the calling workflow.
2424

25-
`limit_to_pr_opened`: Only take action when PR status is opened or reopened. Default = false.
26-
2725
## Permissions
2826

2927
#### Explicit rights
@@ -82,7 +80,6 @@ jobs:
8280
- uses: bcgov/action-pr-description-add@main
8381
with:
8482
github_token: "${{ secrets.GITHUB_TOKEN }}"
85-
limit_to_pr_opened: "true"
8683
add_markdown: |
8784
---
8885
@@ -104,6 +101,10 @@ BC Government QuickStart for OpenShift - [Issues](https://github.com/bcgov/quick
104101
105102
BC Government QuickStart for OpenShift - [Discussions](https://github.com/bcgov/quickstart-openshift/discussions)
106103
104+
## Deprecations
105+
106+
The parameter `limit_to_pr_opened` was deprecated due to non-use. Using this parameter will result in a warning only.
107+
107108
## Contributing
108109

109110
Contributions are always welcome! Please send us pull requests or get in touch at the links above.

action.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ inputs:
1212
github_token:
1313
description: "GitHub token or a Personal Access Token (PAT)"
1414
default: ${{ github.token }}
15-
limit_to_pr_opened:
16-
description: "Only run when a PR is opened or reopened, not pushed"
17-
default: "false"
1815

1916
runs:
2017
using: "node20"

src/main.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,13 @@ import {context, getOctokit} from '@actions/github'
44
// Action input
55
const markdown = getInput('add_markdown')
66
const token = getInput('github_token')
7-
const limit_to_pr_opened = getInput('limit_to_pr_opened')
87

9-
if (!markdown || !token || !limit_to_pr_opened) {
8+
if (!markdown || !token) {
109
error('Error: please verify input!')
1110
}
1211

1312
// Main function
1413
async function action(): Promise<void> {
15-
// If limit_to_pr_opened is true, verify status (opened, reopened)
16-
const trigger = context.payload.action || ''
17-
const statuses = ['opened', 'reopened']
18-
if (limit_to_pr_opened === 'true' && !statuses.includes(trigger)) {
19-
info('PR not opened or reopened with limit_to_pr_opened=true. Exiting.')
20-
return
21-
}
22-
2314
// Ensure pull request exists
2415
if (!context.payload.pull_request) {
2516
error('Error: No pull request found in context. Exiting.')

0 commit comments

Comments
 (0)