Skip to content

Commit

Permalink
[refactor][Dockerfile, entrypoint] Move pkg install to Dockerfile
Browse files Browse the repository at this point in the history
**Why this change was necessary**
Installing within the docker image cleans up the logs when using the action.

**What this change does**
Moves `apt-get` commands from `entrypoint.sh` to `Dockerfile`.

**Additional context/notes/links**

Resolves: #6

Signed-off-by: jidicula <johanan.idicula@gmail.com>
  • Loading branch information
jidicula committed May 23, 2020
1 parent e1046db commit e56e262
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,8 @@ LABEL "repository"="https://github.com/jidicula/github-action-clang-format.git"
LABEL "homepage"="https://github.com/jidicula/github-action-clang-format"
LABEL "maintainer"="jidicula <johanan.idicula@mail.mcgill.ca>"

# Install clang-format
RUN apt-get update && apt-get install -y --no-install-recommends clang-format-10

COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# clang-format-action
GitHub Action for clang-format

This action checks all C files (.c and .h) in the GitHub workspace are formatted correctly using the [precompiled Python wheel](https://pypi.org/project/clang-format/) for `clang-format`.
This action checks all C files (.c and .h) in the GitHub workspace are formatted correctly using `clang-format`.

The action returns:

Expand Down
4 changes: 0 additions & 4 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
# Define your own formatting rules in a .clang-format file at your repository
# root. Otherwise, the LLVM style guide is used as a default.

# Install clang-format 10.0.0
apt-get update || exit 3
apt-get install -y clang-format-10 || exit 3

###############################################################################
# format_diff function #
###############################################################################
Expand Down

0 comments on commit e56e262

Please sign in to comment.