-
-
Notifications
You must be signed in to change notification settings - Fork 59
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
3 changed files
with
11 additions
and
8 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 |
---|---|---|
|
@@ -148,19 +148,22 @@ jobs: | |
PASTEBIN_API_KEY: ${{ secrets.PASTEBIN_API_KEY }} | ||
id: create-pastebin | ||
run: | | ||
diff_content=$(cat changes.diff) | ||
# Use a URL-encoded paste name to handle special characters | ||
paste_name=$(echo "radio-t.com Site Changes for PR #${{ github.event.pull_request.number }}, commit ${{ github.sha }}" | jq -sRr @uri) | ||
# Post the diff file directly from changes.diff | ||
# https://pastebin.com/doc_api | ||
paste_output=$(curl --silent "https://pastebin.com/api/api_post.php" \ | ||
-d "api_dev_key=$PASTEBIN_API_KEY" \ | ||
-d "api_option=paste" \ | ||
-d "api_paste_expire_date=1M" \ | ||
-d "api_paste_format=diff" \ | ||
-d "api_paste_private=0" \ | ||
-d "api_paste_code=${diff_content}" \ | ||
-d "api_paste_name=radio-t.com Site Changes for PR #${{ github.event.pull_request.number }}, commit ${{ github.sha }}") | ||
# Check if the output is a valid URL, otherwise print error | ||
if [[ "$paste_url" == "https://"* ]]; then | ||
-d "api_paste_name=${paste_name}" \ | ||
--data-urlencode "[email protected]" || echo "curl call to pastebin failed") | ||
# Check if the output is a valid URL, otherwise print an error | ||
if [[ "$paste_output" == "https://"* ]]; then | ||
echo "PASTE_URL=$paste_output" >> $GITHUB_ENV | ||
else | ||
echo "Error: Failed to create Pastebin paste: $paste_output" >&2 | ||
|
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