Skip to content

Commit

Permalink
Fix linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Roang-zero1 committed Oct 26, 2022
1 parent 0bfc200 commit 08bab82
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM alpine:3.16 as base

RUN apk add --no-cache jq curl
RUN apk add --no-cache jq curl sed

SHELL ["/bin/ash", "-o", "pipefail", "-c"]
RUN curl -s https://api.github.com/repos/dahlia/submark/releases/tags/0.3.1 | jq -r '.assets[] | select(.browser_download_url | contains("linux-x86_64")) | .browser_download_url' | xargs curl -o /usr/local/bin/submark -sSL && chmod +x /usr/local/bin/submark
Expand Down
22 changes: 13 additions & 9 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ create_release_data() {
RELEASE_BODY=$(submark -O --"$INPUT_CHANGELOG_HEADING" "$TAG" "$INPUT_CHANGELOG_FILE")
if [ -n "${RELEASE_BODY}" ]; then
echo "::notice::Changelog entry found, adding to release"
RELEASE_BODY="${RELEASE_BODY//'%'/'%25'}"
RELEASE_BODY="${RELEASE_BODY//$'\n'/'%0A'}"
RELEASE_BODY="${RELEASE_BODY//$'\r'/'%0D'}"
RELEASE_BODY=$(echo "$RELEASE_BODY" | sed -z 's/%/%25/g')
RELEASE_BODY=$(echo "$RELEASE_BODY" | sed -z 's/\n/%0A/g')
RELEASE_BODY=$(echo "$RELEASE_BODY" | sed -z 's/\r/%0D/g')
echo "changelog=${RELEASE_BODY}" >>"$GITHUB_OUTPUT"
RELEASE_DATA=$(echo "${RELEASE_DATA}" | jq --arg body "${RELEASE_BODY}" '.body = $body')
else
Expand Down Expand Up @@ -123,9 +123,11 @@ if [ "$HTTP_STATUS" -eq 200 ]; then

if [ "$HTTP_STATUS" -eq 200 ]; then
echo "::notice::Release updated"
echo "id=$(echo "$CONTENT" | jq ".id")" >>"$GITHUB_OUTPUT"
echo "html_url=$(echo "$CONTENT" | jq ".html_url")" >>"$GITHUB_OUTPUT"
echo "upload_url=$(echo "$CONTENT" | jq ".upload_url")" >>"$GITHUB_OUTPUT"
{
echo "id=$(echo "$CONTENT" | jq ".id")"
echo "html_url=$(echo "$CONTENT" | jq ".html_url")"
echo "upload_url=$(echo "$CONTENT" | jq ".upload_url")"
} >>"$GITHUB_OUTPUT"
else
echo "::error::Failed to update release ($HTTP_STATUS):"
echo "$CONTENT" | jq ".errors"
Expand All @@ -152,9 +154,11 @@ else

if [ "$HTTP_STATUS" -eq 201 ]; then
echo "::notice::Release successfully created"
echo "id=$(echo "$CONTENT" | jq ".id")" >>"$GITHUB_OUTPUT"
echo "html_url=$(echo "$CONTENT" | jq ".html_url")" >>"$GITHUB_OUTPUT"
echo "upload_url=$(echo "$CONTENT" | jq ".upload_url")" >>"$GITHUB_OUTPUT"
{
echo "id=$(echo "$CONTENT" | jq ".id")"
echo "html_url=$(echo "$CONTENT" | jq ".html_url")"
echo "upload_url=$(echo "$CONTENT" | jq ".upload_url")"
} >>"$GITHUB_OUTPUT"
else
echo "::error::Failed to update release ($HTTP_STATUS):"
echo "$CONTENT" | jq ".errors"
Expand Down

0 comments on commit 08bab82

Please sign in to comment.