Skip to content

Commit

Permalink
[tools] Correct filtering logic for building docs (#19652)
Browse files Browse the repository at this point in the history
The "before" property is only present in the "Push" GitHub Event [1].
Because of this, the script could not correctly detect changes when
running in response to a "Pull Request" GitHub Event [2].

Remove the file filtering logic from the Bash script and instead rely on
the equivalent functionality as provided by GitHub Actions [3].

[1] https://developer.github.com/v3/activity/events/types/#pushevent
[2] https://developer.github.com/v3/pulls/
[3] https://help.github.com/en/articles/workflow-syntax-for-github-actions#onpushpull_requestpaths
  • Loading branch information
jugglinmike authored and foolip committed Oct 11, 2019
1 parent b87b150 commit f162228
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/documentation.yml
Expand Up @@ -2,6 +2,10 @@ on:
push: push:
branches: branches:
- master - master
paths:
- 'docs/**'
- 'resources/**'
- 'tools/**'
pull_request: pull_request:
paths: paths:
- 'docs/**' - 'docs/**'
Expand Down
14 changes: 0 additions & 14 deletions tools/ci/website_build.sh
Expand Up @@ -25,20 +25,6 @@ function targets_master {
test $(json_property ${GITHUB_EVENT_PATH} ref) == 'refs/heads/master' test $(json_property ${GITHUB_EVENT_PATH} ref) == 'refs/heads/master'
} }


function modifies_relevant_files {
base_revision=$(json_property ${GITHUB_EVENT_PATH} before)

git diff --name-only ${base_revision} | \
grep -E --silent '^(docs|tools)/'
}

if ! modifies_relevant_files ; then
echo No files related to the website have been modified. Exiting without
echo building.

exit ${neutral_status}
fi

git config --global user.email "wpt-pr-bot@users.noreply.github.com" git config --global user.email "wpt-pr-bot@users.noreply.github.com"
git config --global user.name "wpt-pr-bot" git config --global user.name "wpt-pr-bot"


Expand Down

0 comments on commit f162228

Please sign in to comment.