Skip to content

ci: add new release version alert #4

ci: add new release version alert

ci: add new release version alert #4

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
run: |
bash scripts/check-new-release-version.sh
if [ $? -eq 1 ]; then
echo "Sending Slack notification..."
MESSAGE="Current version $CURRENT_VERSION is a non-dev version and 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
- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_BOT_TOKEN }}
SLACK_CHANNEL: gh-new-version-alert
SLACK_MESSAGE: ${{ steps.check-versions.outputs.message }}