Skip to content

fetch the full history in the action #7

fetch the full history in the action

fetch the full history in the action #7

on: [push]
jobs:
slack:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get the most recent release tag
run: |
echo "latest_tag=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
- name: Generate git diff
run: |
git diff ${{env.latest_tag}} HEAD > diff.txt
- name: Prepare the Slack message
run: |
DIFF_CONTENT=$(cat diff.txt)
echo "slack_message=Changes from ${{ env.latest_tag }} to HEAD:\n\`\`\`$DIFF_CONTENT\`\`\`" >> $GITHUB_ENV
- name: Post a message to Slack
uses: slackapi/slack-github-action@v2.0.0
with:
method: chat.postMessage
token: ${{secrets.SUBMITTER_HELPDESK_SLACK_BOT_TOKEN}}
payload: |
channel: ${{secrets.TEST_CHANNEL_ID}}
text: ${{env.slack_message}}