get message [breaking] #35
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" | |
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) | |
# echo "LAST_COMMIT=$(git log $GITHUB_SHA --pretty=%B)" >> ${GITHUB_ENV} | |
# echo LAST_COMMIT_HEAD_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]')}} | |
- name: upgrade - should be backwards compatible | |
run: | | |
echo "LAST_COMMIT=$(git log $GITHUB_SHA --pretty=%B)" >> ${GITHUB_ENV} | |
echo LAST_COMMIT_HEAD_MSG=${{github.event.head_commit.message}} >> ${GITHUB_ENV} | |
echo "COMMIT_BREAKING=${{contains(github.event.head_commit.message, '[breaking]')}}" >> ${GITHUB_ENV} | |
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 LAST_COMMIT: ${{ env.LAST_COMMIT }} | |
echo LAST_COMMIT_MSG: ${{ env.LAST_COMMIT_MSG }} | |
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" |