-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI: Skip running tests when only docs changes are detected (#225)
* CI: Skip running tests when only docs changes are detected
- Loading branch information
Showing
6 changed files
with
60 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: get docs changes | ||
|
||
on: | ||
workflow_call: | ||
outputs: | ||
changes_outside_docs: | ||
description: "Changes outside docs" | ||
value: ${{ jobs.get_docs_changes.outputs.changes_outside_docs }} | ||
|
||
jobs: | ||
get_docs_changes: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
changes_outside_docs: ${{ steps.check_changes.outputs.changes_outside_docs }} | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Check changes outside docs | ||
id: check_changes | ||
run: | | ||
echo "base.sha: ${{ github.event.pull_request.base.sha }}" | ||
echo "head.sha: ${{ github.event.pull_request.head.sha }}" | ||
changes_outside_docs=$( | ||
git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} \ | ||
| grep -v '^docs/' || true | ||
) | ||
echo $changes_outside_docs | ||
if [ -z "$changes_outside_docs" ]; then | ||
echo "No changes outside docs. Skipping tests." | ||
echo "changes_outside_docs=false" >> $GITHUB_OUTPUT | ||
else | ||
echo "Changes detected outside docs." | ||
echo "changes_outside_docs=true" >> $GITHUB_OUTPUT | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters