-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1526ef7
commit 642f338
Showing
2 changed files
with
8 additions
and
11 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 |
---|---|---|
|
@@ -12,7 +12,7 @@ on: | |
|
||
permissions: | ||
contents: write | ||
pull-requests: write # 'write' access to pull requests | ||
pull-requests: write # 'write' access to pull requests in order to update test documentation automatically | ||
|
||
jobs: | ||
testing-docs: | ||
|
@@ -40,16 +40,12 @@ jobs: | |
if: env.GIT_DIFF | ||
run: make build-testing-docs | ||
|
||
- name: Check for changes | ||
- name: Check for changes and update automatically | ||
if: env.GIT_DIFF | ||
id: check_changes | ||
id: check_changes_and_update | ||
run: | | ||
git show HEAD:scripts/test_doc/test_documentation.md > committed_file.md | ||
cp scripts/test_doc/test_documentation.md generated_file.md | ||
if ! diff -q generated_file.md committed_file.md; then | ||
if ! git diff --exit-code HEAD:scripts/test_doc/test_documentation.md scripts/test_doc/test_documentation.md; then | ||
echo "Documentation for integration tests is out of date. Updating and pushing changes..." | ||
cp generated_file.md scripts/test_doc/test_documentation.md | ||
if [ -n "$GITHUB_HEAD_REF" ]; then | ||
branch=$GITHUB_HEAD_REF | ||
else | ||
|
@@ -58,13 +54,13 @@ jobs: | |
git fetch origin $branch | ||
git checkout $branch | ||
cp generated_file.md scripts/test_doc/test_documentation.md | ||
cp scripts/test_doc/test_documentation.md scripts/test_doc/test_documentation.md | ||
git config user.name "github-actions" | ||
git config user.email "[email protected]" | ||
git add scripts/test_doc/test_documentation.md | ||
git commit -m "Update testing documentation" | ||
git push origin "$branch" | ||
exit 1 | ||
|
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