dont set msg env [breaking] #32
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: rust ci | |
on: | |
push: | |
tags: | |
- "[0-9]+.[0-9]+.[0-9]+" | |
- "[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+" | |
branches: ["**"] # glob pattern to allow slash / | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
branches: | |
- "release**" | |
- "main**" | |
schedule: | |
- cron: "30 00 * * *" | |
env: | |
DIEM_FORGE_NODE_BIN_PATH: ${{github.workspace}}/diem-node | |
LIBRA_CI: 1 | |
MODE_0L: "TESTNET" | |
# LAST_COMMIT_MSG: ${{github.event.head_commit.message}} | |
jobs: | |
upgrades: | |
timeout-minutes: 60 | |
runs-on: ubuntu-latest | |
steps: | |
# NOTE: for debugging CI this allow shell access to github runner. Will print out tmate.io terminal url | |
# - name: Setup tmate session | |
# uses: mxschmitt/action-tmate@v3 | |
# with: | |
# detached: true | |
# timeout-minutes: 5 | |
- name: Check out code | |
uses: actions/checkout@v3 | |
# should always run unless we know and expect the upgrade to be breaking. In that case we wither explicitly name the branch with breaking, or the commit message as "[breaking]" (for example in the PR title) | |
- name: upgrade - should be backwards compatible | |
run: | | |
#echo "LAST_COMMIT_MSG=$(git log $GITHUB_SHA --pretty=%B)" >> ${GITHUB_ENV} | |
echo LAST_COMMIT_MSG=${{github.event.head_commit.message}} >> ${GITHUB_ENV} | |
echo LAST_COMMIT_MSG: ${{env.LAST_COMMIT_MSG}} | |
echo contains breaking: ${{contains(env.LAST_COMMIT_MSG, '[breaking]')}} | |
echo "COMMIT_BREAKING=${{contains(github.event.head_commit.message, '[breaking]')}}" >> ${GITHUB_ENV} | |
echo github.head_ref: ${{ github.head_ref }} | |
echo ${{contains(github.head_ref, 'breaking-')}} | |
echo github.ref : ${{ github.ref }} | |
echo ${{contains(github.ref, 'breaking-')}} | |
echo github.ref_name: ${{ github.ref_name }} | |
echo ${{contains(github.ref_name, 'breaking-')}} | |
echo "BRANCH_BREAKING=${{contains(github.ref_name, 'breaking-') || contains(github.ref, 'breaking-') || contains(github.head_ref, 'breaking-')}}" >> ${GITHUB_ENV} | |
- name: should run | |
if: ${{env.BRANCH_BREAKING=='true' || env.COMMIT_BREAKING=='true'}} | |
run: | | |
echo BRANCH_BREAKING: ${{ env.BRANCH_BREAKING }} | |
echo COMMIT_BREAKING: ${{ env.COMMIT_BREAKING }} | |
echo "should run" | |
- name: shoul not run | |
if: ${{!env.BRANCH_BREAKING=='true'}} | |
run: | |
echo "should not run" |