https://github.com/picocentauri/comment-artifact
GitHub Actions for updating PR description with a link to download an artifact
https://github.com/picocentauri/comment-artifact
artifacts comments-widget download github-actions
Last synced: 2 months ago
JSON representation
GitHub Actions for updating PR description with a link to download an artifact
- Host: GitHub
- URL: https://github.com/picocentauri/comment-artifact
- Owner: PicoCentauri
- License: mit
- Created: 2024-05-18T08:43:59.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-07T07:51:38.000Z (over 1 year ago)
- Last Synced: 2025-03-07T08:30:57.622Z (over 1 year ago)
- Topics: artifacts, comments-widget, download, github-actions
- Language: Shell
- Homepage:
- Size: 5.24 MB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# Add artifact link to Pull Requests
Comment Actions Artifacts from your Workflow Runs.
The action automatically edits Pull Requests' descriptions with link to download
one or more artifacts. This action is heavily inspired by the
[ReadTheDocs action](https://github.com/readthedocs/actions/tree/main/preview)
and [download-artifact action](https://github.com/actions/download-artifact)
## Usage
```yaml
- uses: PicoCentauri/comment-artifact@v1
with:
# Name of the artifact to link.
name:
# Description of the artifact download link.
# Default is 'Download artifact for this pull request'
description:
# Destination path. Supports basic tilde expansion.
# Optional. Default is $GITHUB_WORKSPACE
path:
# The GitHub token used to authenticate with the GitHub API.
# This is required when downloading artifacts from a different repository
# or from a different workflow run.
# Optional. If unspecified, the action will download artifacts from the
# current repo and the current workflow run.
github-token:
# The repository owner and the repository name joined together by "/".
# If github-token is specified, this is the repository that artifacts will
#be downloaded from.
# Optional. Default is ${{ github.repository }}
repository:
# The id of the workflow run where the desired download artifact was
# uploaded from. If github-token is specified, this is the run that
# artifacts will be downloaded from.
# Optional. Default is ${{ github.run_id }}
run-id:
```
> [!IMPORTANT]
>
> Ensure that your action has the correct _write_ >
> [permissions](https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs).
> You can set these permissions either at the root level of a workflow:
>
> ```yaml
> name: 'My workflow'
>
> on: [push]
> permissions:
> pull-requests: write
>
> jobs: ...
> ```
>
> or within the specific job where you want to use the `comment-artifact`
> action:
>
> ```yaml
> jobs:
> stale:
> runs-on: ubuntu-latest
>
> permissions:
> pull-requests: write
> ```
>
> Note that job-level permissions override root-level permissions. If you set
> `pull-requests: write` at the root level and have non-empty permissions at the
> job level without specifying them there, the action will fail.
## Example

## Contributing
If you want to help improving this action take a look the
[contributing instructions](./CONTRIBUTING.md).