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 601cb69
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,27 @@ 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:
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 601cb69

Please sign in to comment.