Skip to content

Commit

Permalink
Allow running a command before the action
Browse files Browse the repository at this point in the history
  • Loading branch information
ammaraskar committed Dec 24, 2019
1 parent 1eb6b2c commit bbd4951
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ inputs:
The command used to build your documentation (defaults to `make html`)
required: false
default: make html
pre-build-command:
description:
Run before the build command, you can use this to install system level
dependencies.
required: false
runs:
using: 'docker'
image: 'Dockerfile'
5 changes: 5 additions & 0 deletions entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
# Github specific setup is done here to make it easy to test the action code
# in isolation.
if __name__ == "__main__":
if 'INPUT_PRE-BUILD-COMMAND' in os.environ:
pre_command = os.environ['INPUT_PRE-BUILD-COMMAND']
print("Running: {}".format(pre_command))
os.system(pre_command)

github_env = action.GithubEnvironment(
sha=os.environ['GITHUB_SHA'], repo=os.environ['GITHUB_REPOSITORY'],
# For the GITHUB_TOKEN, we want to be able to proceed even if the
Expand Down

0 comments on commit bbd4951

Please sign in to comment.