From 9300c96f7cadb6514a7cfc44cd34f101e6040749 Mon Sep 17 00:00:00 2001 From: Vinay Sharma Date: Fri, 22 Nov 2019 10:05:29 +0530 Subject: [PATCH 1/3] feat(push): add input --- action.yml | 7 ++++++- entrypoint.sh | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index a91188a..1ec66db 100644 --- a/action.yml +++ b/action.yml @@ -8,8 +8,13 @@ inputs: tex_path: # id of input description: 'Path of Tex File' required: true + push: + description: 'String stating whether to push output PDF, PDF will only be pushed in case of "yes"' + default: 'yes' + required: false runs: using: 'docker' image: 'Dockerfile' args: - - ${{ inputs.tex_path }} \ No newline at end of file + - ${{ inputs.tex_path }} + - ${{ inputs.push }} \ No newline at end of file diff --git a/entrypoint.sh b/entrypoint.sh index a64fb6d..29abb42 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,10 +1,15 @@ #!/usr/bin/env bash set -e - echo "Compiling $1" tectonic $1 +PUSH_OUTPUT=$(echo "$2" | tr '[:upper:]' '[:lower:]') + +if [[ $PUSH_OUTPUT != "yes" ]]; then # Don't push PDF + exit 0; +fi + OUTPUT_PDF="${1%.*}.pdf" if [[ ${OUTPUT_PDF:0:1} == "/" ]]; then From 947b410b0e5555bfde76dcc4757c7bbb6b9d4aec Mon Sep 17 00:00:00 2001 From: Vinay Sharma Date: Mon, 16 Dec 2019 18:58:38 +0530 Subject: [PATCH 2/3] Update README.md --- README.md | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e22eb59..156bf36 100644 --- a/README.md +++ b/README.md @@ -8,10 +8,35 @@ This action compiles latex files using [Tectonic](https://tectonic-typesetting.g **Required** Path of tex, xtx file to compile. +### `push` + +**Optional** Compiled PDF is pushed, if `push` is passed as 'yes'. + ## Outputs -Pushes a Compiled PDF file parallel to the tex, xtx file. +Pushes a Compiled PDF file parallel to the tex, xtx file, if push is passed as 'yes'. ## Example usage + +### Pushes Compiled PDF +``` +on: [push] + +jobs: + latex-job: + runs-on: ubuntu-latest + name: A job to Compile Latex file + steps: + - uses: actions/checkout@v1 + - name: Compilation + uses: vinay0410/tectonic-action@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tex_path: 'dir/file.tex' + push: 'yes' +``` + +### Doesn't Push Compiled PDF ``` on: [push] From 32248a3e8f84cda29df1e694c24225a3372f00b3 Mon Sep 17 00:00:00 2001 From: Vinay Sharma Date: Mon, 16 Dec 2019 18:59:21 +0530 Subject: [PATCH 3/3] Update action.yml --- action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index 1ec66db..bb11f8f 100644 --- a/action.yml +++ b/action.yml @@ -10,11 +10,11 @@ inputs: required: true push: description: 'String stating whether to push output PDF, PDF will only be pushed in case of "yes"' - default: 'yes' + default: 'no' required: false runs: using: 'docker' image: 'Dockerfile' args: - ${{ inputs.tex_path }} - - ${{ inputs.push }} \ No newline at end of file + - ${{ inputs.push }}