-
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.
Fix toot workflow and formatting (#1511)
### What kind of change does this PR introduce? * Toots toot better now. ### Does this PR introduce a breaking change? No. Only my confidence as a programmer has been broken by this PR. ### Other information: Praise Mastodon.
- Loading branch information
1 parent
c3c05bc
commit 983818c
Showing
3 changed files
with
10 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,30 +46,30 @@ jobs: | |
RELEASE_DESCRIPTION=$(echo "$RELEASE_INFO" | jq -r .body) | ||
# Remove Markdown links and the space preceding them | ||
CLEANED_DESCRIPTION=$(echo "$RELEASE_DESCRIPTION" | sed -E 's/\[([^\]]+)\]\([^)]+\)//g') | ||
CLEANED_DESCRIPTION=$(echo "$RELEASE_DESCRIPTION" | sed -E 's/\ \(\[[^]]+\]\([^)]+\)\)//g') | ||
# Extract the first line of the release description | ||
CONTRIBUTORS=$(echo "$CLEANED_DESCRIPTION" | head -n 1) | ||
echo "CONTRIBUTORS=${CONTRIBUTORS}" >> $GITHUB_ENV | ||
echo "contributors=${CONTRIBUTORS}" >> $GITHUB_ENV | ||
- name: Prepare Message | ||
id: render_template | ||
uses: chuhlomin/render-template@v1.7 | ||
uses: chuhlomin/render-template@v1.8 | ||
with: | ||
template: publish-mastodon.template.md | ||
template: .github/publish-mastodon.template.md | ||
vars: | | ||
version: ${{ env.version }} | ||
contributors: ${{ env.CONTRIBUTORS }} | ||
version: ${{ env.version }} | ||
- name: Message Preview | ||
run: echo "${{ steps.render_template.outputs.result }}" | ||
run: | | ||
echo "${{ steps.render_template.outputs.result }}${{ env.contributors }}" | ||
- name: Send toot to Mastodon | ||
if: ${{ !github.event.inputs.dry-run }} | ||
if: ${{ github.event.inputs.dry-run != 'true' }} || ${{ github.event_name == 'release' }} | ||
uses: cbrgm/[email protected] | ||
with: | ||
message: ${{ steps.render_template.outputs.result }} | ||
message: "${{ steps.render_template.outputs.result }}${{ env.contributors }}" | ||
visibility: "public" | ||
env: | ||
MASTODON_URL: ${{ secrets.MASTODON_URL }} | ||
|
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