-
Notifications
You must be signed in to change notification settings - Fork 249
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI: Add link to flatpak build in PR comment (#718)
- Loading branch information
1 parent
540926f
commit d10ae12
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# This adds a comment to a PR with a link to any build artifacts. Because build | ||
# artifacts are not available until a workflow is completed, this is done in a | ||
# second workflow that triggers on completion of the workflow that builds the | ||
# artifacts. | ||
name: Linking to artifacts in PR | ||
on: | ||
workflow_run: | ||
workflows: ["Testing"] | ||
types: [completed] | ||
|
||
jobs: | ||
artifacts-url-comments: | ||
name: Add artifact links to PRs | ||
runs-on: ubuntu-20.04 | ||
if: ${{ github.event.workflow_run.event == 'pull_request' }} | ||
steps: | ||
# This uses a third-party action that handles figuring out the | ||
# pull request to comment on (which is no longer easily available | ||
# in a followup workflow) and formatting the comment. | ||
- name: Add artifact links to PR and issues | ||
uses: tonyhallett/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
prefix: "Automatically generated build artifacts for commit ${{ github.event.workflow_run.head_sha }} (note: these links will expire after some time):\n" | ||
format: " - {name}: [:arrow_double_down: Download]({url})" | ||
# This adds a hline to terminate the artifact list, just | ||
# newlines should work, but it seems they are eaten | ||
# somewhere... | ||
suffix: "---\n\nTo test this PR, download and unzip the flatpak application above and then install with:\n\n flatpak install Hamster.flatpak\n" |