Skip to content

Commit

Permalink
Fix toot workflow and formatting (#1511)
Browse files Browse the repository at this point in the history
### 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
Zeitsperre authored Oct 24, 2023
1 parent c3c05bc commit 983818c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ New #xclim release: {{ .version }} 🎉
Latest source code available at: https://github.com/Ouranosinc/xclim/releases/tag/{{ .version }}
Check out the docs for more information: https://xclim.readthedocs.io/en/stable/

{{ .contributors }}
18 changes: 9 additions & 9 deletions .github/workflows/publish-mastodon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ repos:
- id: trailing-whitespace
exclude: setup.cfg
- id: end-of-file-fixer
exclude: '.ipynb'
exclude: '.ipynb|.github/publish-mastodon.template.md'
- id: check-json
- id: check-toml
- id: check-yaml
Expand Down

0 comments on commit 983818c

Please sign in to comment.