Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ankitjain28may/list-files-in-pr
https://github.com/ankitjain28may/list-files-in-pr
Last synced: 7 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/ankitjain28may/list-files-in-pr
- Owner: ankitjain28may
- License: mit
- Created: 2020-11-08T14:45:33.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2020-11-09T10:41:28.000Z (about 4 years ago)
- Last Synced: 2024-10-19T11:42:14.959Z (about 1 month ago)
- Language: JavaScript
- Homepage:
- Size: 185 KB
- Stars: 3
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# List Files in PR
List the files in the pull request in Github Actions. This package is using the Graphql GitHub APIs for fetching the list of files changed in a particular pull request. It is currently enabled for the `pull_request` type of events only.
The output will be available via the `steps` output context.
## Usage
Check the [actions.yml](https://github.com/ankitjain28may/list-files-in-pr/blob/master/action.yml) for the complete format of the required inputs and outputs.
```yaml
- uses: ankitjain28may/[email protected]
with:
githubToken: ${{ github.token }}
outputFormat: 'json' # It can be csv, new-line, space-delimited as well. default is json
```### Get the list of files in a PR
```yaml
- uses: ankitjain28may/[email protected]
id: list-files
with:
githubToken: ${{ github.token }}
outputFormat: 'space-delimited'
- run: |
for file in ${{ steps.list-files.outputs.pullRequestFiles }}; do
echo "Changed Files - ${file}."
done```
## License
Copyright (c) 2020 Ankit Jain - Released under MIT License