enh: ga author and commit messaage

This commit is contained in:
Ben Allfree 2023-10-02 22:54:22 -07:00
parent ec16626252
commit 6c09c35acb

View File

@ -15,9 +15,12 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 20.x
- run: yarn install
- run: yarn lint
- run: yarn build
- name: Prepare build
run: |
yarn install
yarn lint
yarn build
- name: Publish www to Cloudflare Pages
uses: cloudflare/pages-action@v1
@ -43,12 +46,8 @@ jobs:
branch: ${{ github.head_ref || github.ref_name }}
wranglerVersion: '3'
- name: Add SHORT_SHA env property with commit short sha
id: vars
run: echo "sha=`echo ${GITHUB_SHA} | cut -c1-8`" >> "$GITHUB_OUTPUT"
run: echo "message=`${{ github.event.head_commit.message }}`" >> "$GITHUB_OUTPUT"
run: echo "author=`${{ github.event.head_commit.author.name }}`" >> "$GITHUB_OUTPUT"
run: echo "url=`${{ github.event.head_commit.url }}`" >> "$GITHUB_OUTPUT"
- name: Expose git commit data
uses: rlespinasse/git-commit-data-action@v1
- name: Discord feature branch notification
if: github.ref_name != 'master'
@ -56,7 +55,7 @@ jobs:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
uses: Ilshidur/action-discord@master
with:
args: '**PREVIEW** ${{ steps.www_deploy.outputs.url }} and ${{ steps.dashboard_deploy.outputs.url }} were generated from [${{ steps.vars.outputs.sha }}](https://github.com/${{ github.repository}}/commit/${{ github.sha }}) on [${{ github.repository}}#${{ github.ref_name }}](https://github.com/${{ github.repository}}/tree/${{ github.ref_name }})'
args: '**PREVIEW** ${{ steps.www_deploy.outputs.url }} and ${{ steps.dashboard_deploy.outputs.url }} were generated by ${{ github.actor }} in [${{ env.GIT_COMMIT_SHORT_SHA }}](https://github.com/${{ github.repository}}/commit/${{ github.sha }}) on [${{ github.repository}}#${{ github.ref_name }}](https://github.com/${{ github.repository}}/tree/${{ github.ref_name }}) with memo `${{ env.GIT_COMMIT_MESSAGE_SUBJECT }}`'
- name: Discord live branch notification
if: github.ref_name == 'master'
@ -64,4 +63,4 @@ jobs:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
uses: Ilshidur/action-discord@master
with:
args: '**LIVE** https://pockethost.io ([permalink](${{ steps.www_deploy.outputs.url }})) and https://app.pockethost.io ([permalink](${{ steps.dashboard_deploy.outputs.url }})) were updated by ${{ steps.vars.author }} in [${{ steps.vars.outputs.sha }}](${{ steps.var.outputs.url }}) on [${{ github.repository}}#${{ github.ref_name }}](https://github.com/${{ github.repository}}/tree/${{ github.ref_name }}): ${{ steps.vars.message }}'
args: '**LIVE** https://pockethost.io ([permalink](${{ steps.www_deploy.outputs.url }})) and https://app.pockethost.io ([permalink](${{ steps.dashboard_deploy.outputs.url }})) were updated by ${{ github.actor }} in [${{ env.GIT_COMMIT_SHORT_SHA }}](https://github.com/${{ github.repository}}/commit/${{ github.sha }}) on [${{ github.repository}}#${{ github.ref_name }}](https://github.com/${{ github.repository}}/tree/${{ github.ref_name }}): ${{ env.GIT_COMMIT_MESSAGE_SUBJECT }}'