Merge pull request #88 from TON-42/danielgomeza1406/cha-586-change-home #52
Workflow file for this run
This file contains 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: Possible new production release | |
on: | |
push: | |
branches: | |
- preview | |
jobs: | |
check-main: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout preview branch | |
uses: actions/checkout@v2 | |
with: | |
ref: preview | |
- name: Fetch main branch | |
run: git fetch origin main | |
- name: Check if main is behind preview | |
id: check | |
run: | | |
BEHIND=$(git rev-list --left-right --count origin/main...origin/preview | awk '{print $2}') | |
echo "BEHIND=$BEHIND" >> $GITHUB_ENV | |
if [ "$BEHIND" -gt 0 ]; then | |
echo "CREATE_ISSUE=true" >> $GITHUB_ENV | |
echo "BEHIND_COUNT=$BEHIND" >> $GITHUB_ENV | |
else | |
echo "CREATE_ISSUE=false" >> $GITHUB_ENV | |
continue-on-error: true | |
- name: Send Discord notification | |
if: env.CREATE_ISSUE == 'true' | |
env: | |
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} | |
uses: Ilshidur/action-discord@master | |
with: | |
args: "The main branch is behind the preview branch by ${{ env.BEHIND_COUNT }} commits in the repository ${{ github.repository }}." |