Skip to content

Commit

Permalink
github-action: limit changed files for pull requests (#4049)
Browse files Browse the repository at this point in the history
- use diff with three dots to get changes on branch only
  • Loading branch information
hgy59 authored Jun 28, 2020
1 parent 7049912 commit d17842e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/actions/build_status.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ if [ -f "${BUILD_SUCCESS_FILE}" ]; then
if [ -d packages ]; then
# show built package files
echo ""
echo "ARTIFACTS:"
ls -gh --time-style +"%Y.%m.%d %H:%M:%S" packages/*
echo ""
fi
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ jobs:
if: github.event_name == 'pull_request'
id: getfile_pr
run: |
git diff-tree --no-commit-id --name-only -r origin/master ${{github.event.pull_request.head.sha}} | xargs
echo "::set-output name=files::$(git diff-tree --no-commit-id --name-only -r origin/master ${{github.event.pull_request.head.sha}} | xargs)"
git diff --no-commit-id --name-only -r origin/master...${{github.event.pull_request.head.sha}} | xargs
echo "::set-output name=files::$(git diff --no-commit-id --name-only -r origin/master...${{github.event.pull_request.head.sha}} | xargs)"
- name: Get changed files for push
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') == false
Expand Down

0 comments on commit d17842e

Please sign in to comment.