Skip to content

Commit 3a34319

Browse files
committed
chore: update readme
1 parent 5e1cb99 commit 3a34319

File tree

1 file changed

+43
-7
lines changed

1 file changed

+43
-7
lines changed

Diff for: README.md

+43-7
Original file line numberDiff line numberDiff line change
@@ -42,27 +42,63 @@ jobs:
4242
jira-base-url: ${{ secrets.JIRA_BASE_URL }}
4343
jira-username: ${{ secrets.JIRA_USERNAME }}
4444
jira-api-token: ${{ secrets.JIRA_API_TOKEN }}
45+
update-description: false # Optional: set to true to update PR description instead of commenting
4546
```
4647
4748
## Usage
4849
4950
Once you've set up the workflow, the action will run automatically on every pull request event (when opened, edited, or synchronized). No further action is required.
5051
52+
The action can be configured to either add a comment with the Jira issue details (default behavior) or update the PR description with the information. This can be controlled using the `update-description` input.
53+
5154
## Inputs
5255

53-
| Input | Description | Required |
54-
| ---------------- | ------------------------------------------------------------------ | -------- |
55-
| `github-token` | GitHub token for authentication | Yes |
56-
| `jira-base-url` | Your Jira instance URL (e.g., `https://your-domain.atlassian.net`) | Yes |
57-
| `jira-username` | Your Jira username (usually your email address) | Yes |
58-
| `jira-api-token` | Jira API token for authentication | Yes |
56+
| Input | Description | Required | Default |
57+
| -------------------- | ------------------------------------------------------------------ | -------- | ------- |
58+
| `github-token` | GitHub token for authentication | Yes | N/A |
59+
| `jira-base-url` | Your Jira instance URL (e.g., `https://your-domain.atlassian.net`) | Yes | N/A |
60+
| `jira-username` | Your Jira username (usually your email address) | Yes | N/A |
61+
| `jira-api-token` | Jira API token for authentication | Yes | N/A |
62+
| `update-description` | Update PR description instead of adding a comment | No | false |
5963

6064
## Example
6165

6266
When a pull request is created with the branch name `feature/PROJ-123-new-feature` and the title "Implement new feature", the action will:
6367

6468
1. Update the PR title to "[PROJ-123] Implement new feature"
65-
2. Add a comment to the PR with a link to the Jira issue and its summary
69+
2. Either:
70+
- Add a comment to the PR with a link to the Jira issue and its summary (default behavior)
71+
- Update the PR description to include the Jira issue link and summary (if `update-description` is set to true)
72+
73+
### Example with Description Update
74+
75+
To configure the action to update the PR description instead of commenting:
76+
77+
```yaml
78+
name: Jira Issue Linker
79+
80+
on:
81+
pull_request:
82+
types: [opened, edited, synchronize]
83+
84+
jobs:
85+
jira-issue-link:
86+
runs-on: ubuntu-latest
87+
steps:
88+
- uses: launchdarkly-labs/ld-gh-actions-jira@v1
89+
with:
90+
github-token: ${{ secrets.GITHUB_TOKEN }}
91+
jira-base-url: ${{ secrets.JIRA_BASE_URL }}
92+
jira-username: ${{ secrets.JIRA_USERNAME }}
93+
jira-api-token: ${{ secrets.JIRA_API_TOKEN }}
94+
update-description: true # This will update the PR description instead of commenting
95+
```
96+
97+
When using `update-description: true`, the action will:
98+
99+
1. Add the Jira issue information to the end of the PR description if no Jira section exists
100+
2. Update the existing Jira section if one is already present
101+
3. Create a new PR description with just the Jira information if no description exists
66102

67103
## Development
68104

0 commit comments

Comments
 (0)