Skip to content

ci(pull-request): create a build when a pull request gets created … #10

ci(pull-request): create a build when a pull request gets created …

ci(pull-request): create a build when a pull request gets created … #10

name: Pull request bundle
on: pull_request
jobs:
bundle:
# Triggers the workflow on events of pull requests with the default branch as the target
if: github.base_ref == github.event.repository.default_branch
name: Bundle version snapshot-pr-#${{ github.event.pull_request.number }}
uses: ./.github/workflows/bundle.yml
with:
version: snapshot-pr-#${{ github.event.pull_request.number }}
retention-days: 8
link-snapshot-build-in-pull-request:
runs-on: ubuntu-22.04
needs: bundle
name: Link newly created snapshot build in pull request
permissions:
pull-requests: write
steps:
- name: "Create sticky comment at pull request with link to artifact: ${{ needs.bundle.outputs.artifact-url }}"
uses: marocchino/sticky-pull-request-comment@v2
with:
message: |
A bundle was built by a build job based on the current state of this Pull Request.
Build Job: <${{ needs.bundle.outputs.job-url }}>
Direct download: <${{ needs.bundle.outputs.artifact-url }}>