Skip to content

Commit

Permalink
renable check for changes
Browse files Browse the repository at this point in the history
  • Loading branch information
fzhao99 committed Jan 10, 2024
1 parent f5934a4 commit 6baec95
Showing 1 changed file with 33 additions and 33 deletions.
66 changes: 33 additions & 33 deletions .github/workflows/checkForChanges.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
#name: Check for Changes
## Reusable workflow, compatible with push and pull_request events
#on:
# workflow_call:
# inputs:
# # can be a file or a folder
# what_to_check:
# required: true
# type: string
# outputs:
# has_changes:
# description: true or false string
# value: ${{ jobs.check_for_changes.outputs.has_changes }}
#jobs:
# check_for_changes:
# runs-on: ubuntu-latest
# outputs:
# has_changes: ${{ steps.check_for_changes.outputs.has_changes }}
# steps:
# - uses: actions/checkout@v4
# with:
# fetch-depth: 0
# - shell: bash
# id: check_for_changes
# run: |
# echo "::group::Set has_changes output"
# diff=$(git diff-tree --no-commit-id --name-only -r "origin/main" HEAD -- "${{ inputs.what_to_check }}")
# echo "Diff: $diff"
# diff_length=$(echo ${#diff})
# has_diff=$([ $diff_length -gt 0 ] && echo "true" || echo "false")
# echo "The Changes: ${has_diff}"
# echo "has_changes=${has_diff}" >> "$GITHUB_OUTPUT"
# echo "::endgroup::"
name: Check for Changes
# Reusable workflow, compatible with push and pull_request events
on:
workflow_call:
inputs:
# can be a file or a folder
what_to_check:
required: true
type: string
outputs:
has_changes:
description: true or false string
value: ${{ jobs.check_for_changes.outputs.has_changes }}
jobs:
check_for_changes:
runs-on: ubuntu-latest
outputs:
has_changes: ${{ steps.check_for_changes.outputs.has_changes }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- shell: bash
id: check_for_changes
run: |
echo "::group::Set has_changes output"
diff=$(git diff-tree --no-commit-id --name-only -r "origin/main" HEAD -- "${{ inputs.what_to_check }}")
echo "Diff: $diff"
diff_length=$(echo ${#diff})
has_diff=$([ $diff_length -gt 0 ] && echo "true" || echo "false")
echo "The Changes: ${has_diff}"
echo "has_changes=${has_diff}" >> "$GITHUB_OUTPUT"
echo "::endgroup::"

0 comments on commit 6baec95

Please sign in to comment.