Skip to content

Commit

Permalink
Merge pull request #36 from m-herold/annotations
Browse files Browse the repository at this point in the history
Fix GitHub annotation for using WORKING_DIRECTORY environment variable
  • Loading branch information
norio-nomura authored Nov 25, 2020
2 parents c5cb516 + 0288486 commit 087d8ab
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,6 @@ jobs:
shell: bash

- name: Output on Warnings with WORKING_DIRECTORY environment variable
run: diff <(docker run -v $(pwd):$(pwd) -w $(pwd) --rm --env WORKING_DIRECTORY=Warnings action-swiftlint|sort) Warnings/expected.txt
run: diff <(docker run -v $(pwd):$(pwd) -w $(pwd) --rm --env WORKING_DIRECTORY=Warnings action-swiftlint|sort) <(cat Warnings/expected.txt | sed -E 's/^(.*)file=(.*),(.*)/\1file=Warnings\/\2,\3/')
working-directory: ./test
shell: bash
4 changes: 4 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
# https://help.github.com/en/github/automating-your-workflow-with-github-actions/development-tools-for-github-actions#logging-commands

function stripPWD() {
if ! ${WORKING_DIRECTORY+false};
then
cd - > /dev/null
fi
sed -E "s/$(pwd|sed 's/\//\\\//g')\///"
}

Expand Down

0 comments on commit 087d8ab

Please sign in to comment.