Skip to content

Commit

Permalink
Convert to a composite action
Browse files Browse the repository at this point in the history
  • Loading branch information
SilverRainZ committed Dec 4, 2022
1 parent c82d384 commit 155dc05
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 30 deletions.
14 changes: 12 additions & 2 deletions action.yml
Expand Up @@ -32,5 +32,15 @@ inputs:
default: ''

runs:
using: 'node12'
main: 'main.js'
using: "composite"
steps:
- run: ${{ github.action_path }}/main.sh
shell: bash
env:
# See https://github.com/actions/runner/issues/665
INPUT_DOCUMENTATION_PATH: ${{ inputs.documentation_path }}
INPUT_TARGET_BRANCH: ${{ inputs.target_branch }}
INPUT_TARGET_PATH: ${{ inputs.target_path }}
INPUT_REPOSITORY_PATH: ${{ inputs.repository_path }}
INPUT_REQUIREMENTS_PATH: ${{ inputs.requirements_path }}
INPUT_SPHINX_VERSION: ${{ inputs.sphinx_version }}
26 changes: 0 additions & 26 deletions main.js

This file was deleted.

4 changes: 2 additions & 2 deletions main.sh
Expand Up @@ -6,7 +6,7 @@ set -e
repo_dir=$GITHUB_WORKSPACE/$INPUT_REPOSITORY_PATH
doc_dir=$repo_dir/$INPUT_DOCUMENTATION_PATH
# https://stackoverflow.com/a/4774063/4799273
action_dir="$(cd -- "$(dirname "$-1")" >/dev/null 2>&1 ; pwd -P)"
action_dir=$GITHUB_ACTION_PATH

echo ::group:: Initialize various paths
echo Action: $action_dir
Expand All @@ -26,7 +26,7 @@ else
pip3 install -U sphinx==$INPUT_SPHINX_VERSION
fi

echo Adding user bin to system path
echo Adding ~/.local/bin to system path
PATH=$HOME/.local/bin:$PATH
if ! command -v sphinx-build &>/dev/null; then
echo Sphinx is not successfully installed
Expand Down

0 comments on commit 155dc05

Please sign in to comment.