-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
22 additions
and
51 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
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
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
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
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 |
---|---|---|
@@ -1,27 +1,26 @@ | ||
#!/bin/bash | ||
set -eux | ||
|
||
# find the runner version in Dockerfile | ||
set_comment_output () { | ||
echo "comment=$*" >> "$GITHUB_OUTPUT" | ||
} | ||
|
||
# Find the runner version in Dockerfile | ||
actions_runner_version="$(grep RUNNER_VERSION= Dockerfile | cut -f2 -d=)" | ||
|
||
# post a comment if pull request | ||
if [[ $GITHUB_EVENT_NAME == pull_request ]]; then | ||
if gh release view "$actions_runner_version"; then | ||
gh pr comment "$GITHUB_HEAD_REF" --body-file - <<EOF | ||
:new: If you need to build a new runner image, [create a new release](https://github.com/quipper/actions-runner/releases/new) after merge. | ||
EOF | ||
exit | ||
if gh release view "$actions_runner_version"; then | ||
if [[ $GITHUB_EVENT_NAME == pull_request ]]; then | ||
set_comment_output ":bulb: If you need a new version, [create a new release](https://github.com/quipper/actions-runner/releases/new) after merge." | ||
fi | ||
|
||
gh pr comment "$GITHUB_HEAD_REF" --body-file - <<EOF | ||
:robot: GitHub Actions will automatically create a release ${actions_runner_version} after merge. | ||
EOF | ||
exit | ||
fi | ||
|
||
if gh release view "$actions_runner_version"; then | ||
exit # already exists | ||
if [[ $GITHUB_EVENT_NAME == pull_request ]]; then | ||
set_comment_output ":robot: GitHub Actions will automatically create a release ${actions_runner_version} after merge." | ||
exit | ||
fi | ||
|
||
# create a release if not exists | ||
# Create a release if not exists | ||
GITHUB_TOKEN="$RELEASE_TOKEN" gh release create "$actions_runner_version" --generate-notes | ||
|
||
set_comment_output ":robot: GitHub Actions automatically created a new release ${actions_runner_version}" |