Skip to content

ci: add new release version alert #8

ci: add new release version alert

ci: add new release version alert #8

name: Release Version Alert
on:
pull_request:
branches: [ main ]
jobs:
check-version:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Check versions
id: check-versions
run: |
if [[ "$(bash scripts/check-new-release-version.sh)" == "Found new non-dev version"* ]]; then
echo "Sending Slack notification..."
MESSAGE="Current version $CURRENT_VERSION does not match the version in the main branch ($MAIN_VERSION). :rocket:"
echo "::set-output name=message::$MESSAGE" # Set an output variable to pass the message to the next step
else
echo "No new non-dev version found. Skipping Slack notification."
echo "::set-output name=message::" # Set an empty output variable to ensure no message is passed to the next step
fi
- name: Slack Notification
if: steps.check-versions.outputs.message != ''
uses: slackapi/[email protected]
with:
channel-id: 'C05RVKRFCCF'
slack-message: ${{ steps.check-versions.outputs.message }}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}