Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: credo and oca to gitignore #2230

Merged
merged 7 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/actions/early-exit-check/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Check for early exit
description: |
This action checks for changes in specific directories and
exits early if there are none

runs:
using: composite
steps:
- name: Check location of changed files
shell: bash
run: |
change_count=$(git diff --name-only origin/main..HEAD | grep -E '^(app/.*)|(.yarn/.*)|(.github/workflows/.*)' | wc -l)
echo "$change_count files changed in app, .yarn, or .github/workflows"
if [ $change_count -gt 0 ]; then
# A result greater than 0 means there are changes
# in the specified directories.
echo "result=false" >> $GITHUB_OUTPUT
else
echo "result=true" >> $GITHUB_OUTPUT
fi

# - name: Record output
# if: env.output > 0
# shell: bash
# run: |
# echo "${{ env.output }} files changed in app, .yarn, or .github/workflows"
# echo "result=false" >> $GITHUB_OUTPUT
31 changes: 22 additions & 9 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,6 @@ on:
- .github/workflows/**
pull_request:
branches: [main]
paths:
- app/**
- .yarn/**
- .github/workflows/**
- .gitmodules
- package.json
- yarn.lock
- .yarnrc.yml
- .yarn/**

jobs:
check-secrets:
Expand Down Expand Up @@ -82,6 +73,17 @@ jobs:
runs-on: macos-13
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all branches, main needed.

- name: Run early exit check
id: should_early_exit
uses: ./.github/workflows/actions/early-exit-check

- name: Exit if no changes in core paths
if: steps.should_early_exit.outputs.result == 'true'
run: |
exit 0

- uses: actions/setup-python@v5
with:
Expand Down Expand Up @@ -242,6 +244,17 @@ jobs:
packages: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all branches, main needed.

- name: Run early exit check
id: should_early_exit
uses: ./.github/workflows/actions/early-exit-check

- name: Exit if no changes in core paths
if: steps.should_early_exit.outputs.result == 'true'
run: |
exit 0

- uses: actions/setup-python@v5
with:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,5 @@ app/vendor/bundle/**

# child packages
bifold/
aries-oca-bundles/
credo-ts/
Loading