Skip to content

Commit

Permalink
another test for trap
Browse files Browse the repository at this point in the history
  • Loading branch information
anadelarosa3 committed Sep 10, 2024
1 parent 83dd74c commit 94a2b7d
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 21 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/android.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ jobs:
should_run: ${{ steps.check_changes.outputs.run_tests }}
steps:
# Checkout repo to Github Actions runner
# This is another test
# Changing file
# One more test
# One more test
- name: Checkout
uses: actions/checkout@v4
with:
Expand Down
18 changes: 2 additions & 16 deletions ci/files_changed.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,8 @@ trap 'echo "An unexpected error occurred during file change check."; echo "check
# base_ref="origin/$GITHUB_BASE_REF"
#fi


# Check if current branch is main
is_main_branch=false
if git rev-parse --abbrev-ref HEAD | grep -q ^main$; then
is_main_branch=true
fi


# Check for file changes using the base ref
changes_detected=false
if $is_main_branch || git diff --name-only "origin/$GITHUB_BASE_REF" | grep -E "$1"; then
changes_detected=true
fi

# Check for file changes
if [ "$changes_detected" = true ]; then
# Check if the base ref exists before running the git diff
if git rev-parse --abbrev-ref HEAD | grep -q ^main$ || git fetch origin "$GITHUB_BASE_REF" && git diff --name-only "origin/$GITHUB_BASE_REF" | grep -E "$1" ; then
echo "Relevant file changes detected!"
echo "check_result=0" >> "$GITHUB_OUTPUT"
exit 0 # Relevant changes detected
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import org.junit.Assert.*
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
* TEST change
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
Expand Down

0 comments on commit 94a2b7d

Please sign in to comment.