Fix bash syntax error: missing closing quote in builds-mattermost.yaml #37
This file contains hidden or 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
| name: Builds-Mastodon | |
| on: | |
| workflow_call: | |
| secrets: | |
| MASTODON_URL: | |
| required: true | |
| MASTODON_ACCESS_TOKEN: | |
| required: true | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| notify: | |
| name: Mastodon | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: technote-space/workflow-conclusion-action@v3 | |
| - name: Set Icons | |
| env: | |
| STATUS: ${{ env.WORKFLOW_CONCLUSION }} | |
| run: | | |
| ICON=":white_check_mark:" | |
| if [ "${STATUS}" == "failure" ]; then | |
| ICON=":red_circle:" | |
| fi | |
| export ICON | |
| echo "ICON=\"${ICON}\"" >> $GITHUB_ENV | |
| - name: Trim Body | |
| env: | |
| COMMIT_MESSAGE: ${{ toJSON(github.event.head_commit.message) }} | |
| shell: bash | |
| run: | | |
| BODYLINE="$COMMIT_MESSAGE" | |
| BODYLINE="${BODYLINE#\"}" | |
| BODYLINE="${BODYLINE%\"}" | |
| TRIMMED_BODY="${BODYLINE:0:350}" | |
| echo "BODY=${TRIMMED_BODY}" >> $GITHUB_ENV | |
| - name: Send toot to Mastodon | |
| id: mastodon | |
| continue-on-error: true | |
| uses: cbrgm/mastodon-github-action@v1 | |
| env: | |
| REPOSITORY: ${{ github.repository }} | |
| REPOSITORY_URL: ${{ github.repository.html_url }} | |
| REF: ${{ github.ref_name }} | |
| ACTOR: ${{ github.actor }} | |
| BODY: ${{ github.env.BODY }} | |
| STATUS: ${{ env.WORKFLOW_CONCLUSION }} | |
| MASTODON_URL: ${{ secrets.MASTODON_URL }} | |
| MASTODON_ACCESS_TOKEN: ${{ secrets.MASTODON_ACCESS_TOKEN }} | |
| LINK: ${{ github.event.head_commit.url }} | |
| with: | |
| message: | | |
| ${{ env.REPOSITORY }} build by ${{ env.ACTOR }} | |
| Branch: ${{ env.REF }} | |
| Status: ${{ env.icon }} ${{ env.STATUS }} | |
| ${{ env.BODY }} | |
| ${{ env.LINK }} | |
| visibility: "public" | |