Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
Signed-off-by: M. Fatih Cırıt <[email protected]>
  • Loading branch information
M. Fatih Cırıt committed Jun 12, 2024
1 parent c276b73 commit 23c1d8c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 11 deletions.
29 changes: 25 additions & 4 deletions get-modified-packages/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ This action get the list of ROS packages modified in the pull request.

## Usage

### Basic

```yaml
jobs:
get-modified-packages:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

Expand All @@ -19,11 +21,30 @@ jobs:
uses: autowarefoundation/autoware-github-actions/get-modified-packages@v1
```
### Fetch only the PR branch and all PR commits
```yaml
jobs:
get-modified-packages:
runs-on: ubuntu-latest
steps:
- name: Set PR fetch depth
run: echo "PR_FETCH_DEPTH=$(( ${{ github.event.pull_request.commits }} + 1 ))" >> "${GITHUB_ENV}"

- name: Checkout PR branch and all PR commits
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: ${{ env.PR_FETCH_DEPTH }}

- name: Get modified packages
id: get-modified-packages
uses: autowarefoundation/autoware-github-actions/get-modified-packages@v1
```
## Inputs
| Name | Required | Description |
| ----------- | -------- | ------------------------------------------------ |
| base-branch | false | The base branch to search for modified packages. |
None.
## Outputs
Expand Down
8 changes: 1 addition & 7 deletions get-modified-packages/action.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
name: get-modified-packages
description: ""

inputs:
base-sha:
description: ""
required: false
default: ${{ github.event.pull_request.base.sha }}

outputs:
modified-packages:
description: ""
Expand All @@ -23,7 +17,7 @@ runs:
- name: Get modified packages
id: get-modified-packages
run: |
echo "modified-packages=$(${GITHUB_ACTION_PATH}/get-modified-packages.sh ${{ inputs.base-sha }})" >> $GITHUB_OUTPUT
echo "modified-packages=$(${GITHUB_ACTION_PATH}/get-modified-packages.sh ${{ github.event.pull_request.base.sha }})" >> $GITHUB_OUTPUT
shell: bash

- name: Show result
Expand Down

0 comments on commit 23c1d8c

Please sign in to comment.