Skip to content

artifact2pr

Actions

About

Upload build artifacts to a pull request
v1.1.2
Latest
Star (0)

Artifact2PR

Release Build Status Last Commit License: MIT

A GitHub Action to automatically post links to build artifacts as a comment on pull requests.

Features

  • Posts a comment with download links to all artifacts generated by the workflow run.
  • Optionally comments a warning if no artifacts are found.
  • Can be triggered conditionally (e.g., by label or workflow logic).

Inputs

Name Description Required Default
github-token GitHub token for authentication Yes ${{ github.token }}
comment-heading Heading for the comment No 📦 **Build Artifacts**
comment-if-no-artifacts Comment posted if no artifacts are found No ""

Usage

Add this action to your workflow after your build and artifact upload steps:

- name: Post artifact links to PR
  uses: RubberDuckCrew/artifact2pr@v1
  with:
    github-token: ${{ secrets.GITHUB_TOKEN }}
    comment-heading: "📦 **Build Artifacts**"
    comment-if-no-artifacts: "⚠️ No artifacts found."

Note: Your workflow or job must include the following permissions:

permissions:
  pull-requests: write

Example Workflow

name: Build and Post Artifacts
on:
  pull_request:

jobs:
  build:
    runs-on: ubuntu-latest
    permissions:
      pull-requests: write

    steps:
      - uses: actions/checkout@v6

      - name: Build
        run: |
          echo "Build your project here"

      - name: Upload Artifact
        uses: actions/upload-artifact@v7
        with:
          name: my-artifact
          path: ./path/to/artifact

      - name: Post artifact links to PR
        uses: RubberDuckCrew/artifact2pr@v1
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          comment-heading: "📦 **Build Artifacts**"
          comment-if-no-artifacts: "⚠️ No artifacts found."

Notes

  • The action only runs on pull requests.
  • Artifact download links require appropriate repository permissions.
  • Artifacts are available for a limited time (default: 90 days).

License

MIT

artifact2pr is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Upload build artifacts to a pull request
v1.1.2
Latest

artifact2pr is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.