Skip to content

Commit

Permalink
updates to Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
karpikpl committed Apr 30, 2024
1 parent a36fa6b commit 6326460
Show file tree
Hide file tree
Showing 2 changed files with 100 additions and 3 deletions.
99 changes: 98 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,101 @@
[![CodeQL](https://github.com/karpikpl/azdo-relese-notes-action/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/karpikpl/azdo-relese-notes-action/actions/workflows/codeql-analysis.yml)
[![Coverage](./badges/coverage.svg)](./badges/coverage.svg)

Enhanced AB#xxx links in GitHub release notes for Azure DevOps work items.
Enhanced AB#xxx links in GitHub release notes for Azure DevOps work items. Every `AB#x` reference in the release notes is replaced with a link.

Before:

```md
* AB#11 Feature/adding ci by @karpikpl in https://github.com/repoOwner/repoName/pull/1
```

After:

```md
* [AB#11 [User Story] Best Feature so far (Completed)](https://dev.azure.com/adoOrg/adoProject/_workitems/edit/11) Feature/adding ci by @karpikpl in https://github.com/repoOwner/repoName/pull/1
```

## Usage

### Basic

You need to add permissions for this tool.

```yaml
permissions:
contents: write
```
Here's an example pipeline that updates release notes after publishing.
```yaml
name: Update Release Notes

on:
release:
types: [published]
workflow_dispatch:
inputs:
releaseId:
description: 'The Id of the release to update - database Id (integer), not visible in the UI'
required: true
type: number

permissions:
contents: write

jobs:
update-release-notes:
runs-on: ubuntu-latest

steps:

- name: Install dependencies
run: npm install node-fetch

- name: Update release notes
uses: karpikpl/azdo-relese-notes-action@1.0.0
with:
ado-pat: ${{ secrets.ADO_PAT }}
ado-org: my-org
ado-project: my-project
```
## Inputs
### `ado-pat`

**Required** Azure DevOps personal access token with permissions to read work items.

### `ado-org`

**Required** Name of the Azure DevOps organization.

### `ado-project`

**Required** Name of the Azure DevOps project.

### `repo-owner`

**Optional** Another repository owner, If not set, the current repository owner
is used by default. Note that when you trying changing a repository, be aware
that `GITHUB_TOKEN` should also have permission for that repository.

### `repo-name`

**Optional** Another repository name. Of limited use on GitHub enterprise. If
not set, the current repository is used by default. Note that when you trying
changing a repository, be aware that `GITHUB_TOKEN` should also have permission
for that repository.

### `repo-token`

**Optional**, You can set
[PAT](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token)
here. If not set, this will use `${{ github.token }}`.

## Outputs

### `workItems`

Coma separated list of work items that were processed.
4 changes: 2 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ author: 'Piotr Karpala'

# Add your action's branding here. This will appear on the GitHub Marketplace.
branding:
icon: 'heart'
color: 'red'
icon: 'clipboard'
color: 'purple'

# Define your inputs here.
inputs:
Expand Down

0 comments on commit 6326460

Please sign in to comment.