Skip to content

Commit

Permalink
ci(pull-request): create sticky comment on pull request
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeratoxx committed Mar 2, 2024
1 parent 17f1b4d commit 835bc77
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/bundle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,16 @@ on:
artifact-path:
description: 'Path to built artifact'
value: ${{ jobs.create-win-bundle.outputs.artifact-path }}
artifact-url:
description: 'URL to built artifact'
value: ${{ jobs.create-win-bundle.outputs.artifact-url }}

jobs:
create-win-bundle:
runs-on: ubuntu-22.04
outputs:
artifact-path: ${{ steps.output-artifact-path.outputs.artifact-path }}
artifact-url: ${{ steps.upload-artifact.outputs.artifact-url }}
steps:
# Checks-out repository under $GITHUB_WORKSPACE, so job can access repo files
- uses: actions/checkout@v4
Expand Down Expand Up @@ -54,6 +58,7 @@ jobs:
run: ls -alh

- name: Upload zip as artifact
id: upload-artifact
uses: actions/upload-artifact@v4
with:
name: win-bundle_${{ inputs.version }}
Expand Down
27 changes: 13 additions & 14 deletions .github/workflows/pull-request-bundle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,6 @@ name: Pull request bundle
on: pull_request

jobs:
get-repo-information:
runs-on: ubuntu-22.04
steps:
- name: Get repo information
run: |
echo "github.base_ref: ${{ github.base_ref }}"
echo "ref: ${{ github.ref }}"
echo "ref: ${{ github.ref_name }}"
echo "event ref_name: ${{ github.event.ref_name }}"
echo "event ref_name: ${{ github.event.ref }}"
echo "event ref_name: ${{ github.event.pull_request.number }}"
echo "event ref_name: ${{ github.event.before }}"
echo "event ref_name: ${{ github.event.after }}"
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
Expand All @@ -25,3 +11,16 @@ jobs:
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: ${{ jobs.bundle.outputs.artifact-url }}"
uses: marocchino/sticky-pull-request-comment@v2
with:
message: |
Built bundle based on the current state of this Pull Request here: <${{ jobs.bundle.outputs.artifact-url }}>

0 comments on commit 835bc77

Please sign in to comment.