Skip to content

Commit

Permalink
ci: ensure rust extensions is on main branch
Browse files Browse the repository at this point in the history
  • Loading branch information
NikhilNarayana committed Aug 24, 2023
1 parent 0118db4 commit 942b2c8
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,29 @@ jobs:
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
rust_ver: ${{ steps.rust_ver.outputs.rust_ver }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@master
with:
concurrent_skipping: "same_content"
do_not_skip: '["push", "workflow_dispatch", "schedule"]'

# goal is to prevent merges when the commit is not from the main branch, builds should still succeed
check_rust_commit:
needs: [pre_build]
if: ${{ needs.pre_build.outputs.should_skip != 'true' }}
name: Verify SlippiRustExtensions Commit is in Main
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Main Branch Check
shell: bash
run: |
git submodule update --init Externals/SlippiRustExtensions
cd Externals/SlippiRustExtensions
commit_id=$(git rev-parse HEAD)
git branch --contains $commit_id | grep main
windows:
needs: [pre_build]
if: ${{ needs.pre_build.outputs.should_skip != 'true' }}
Expand Down

0 comments on commit 942b2c8

Please sign in to comment.