From 57fde567f7c878b64eaaf65e02e6d71bc42f7631 Mon Sep 17 00:00:00 2001 From: Nikhil Badyal Date: Thu, 13 Oct 2022 21:43:44 +0530 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20Reusable=20workflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../workflows/telegram-uploader-custom.yml | 21 +++++++------------ .github/workflows/telegram-uploader.yml | 12 +++++++++++ 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/.github/workflows/telegram-uploader-custom.yml b/.github/workflows/telegram-uploader-custom.yml index f812463..e31cbab 100644 --- a/.github/workflows/telegram-uploader-custom.yml +++ b/.github/workflows/telegram-uploader-custom.yml @@ -27,17 +27,10 @@ on: jobs: tg-upload: - timeout-minutes: 10 - runs-on: ubuntu-latest - steps: - - name: Upload to Telegram - if: ${{ env.HAVE_TELEGRAM_API_ID == 'true' }} - uses: nikhilbadyal/ghaction-telegram-uploader@main - with: - API_ID: ${{ inputs.API_ID }} - API_HASH: ${{ inputs.API_HASH }} - BOT_TOKEN: ${{ inputs.BOT_TOKEN }} - CHAT_ID: ${{ inputs.CHAT_ID }} - STICKER_ID: ${{ inputs.STICKER_ID }} -env: - HAVE_TELEGRAM_API_ID: ${{ inputs.API_ID != '' }} + uses: ./.github/workflows/telegram-uploader.yml + secrets: + TELEGRAM_API_ID: ${{ inputs.API_ID }} + TELEGRAM_API_HASH: ${{ inputs.API_HASH }} + TELEGRAM_BOT_TOKEN: ${{ inputs.BOT_TOKEN }} + TELEGRAM_CHAT_ID: ${{ inputs.CHAT_ID }} + STICKER_ID: ${{ inputs.STICKER_ID }} diff --git a/.github/workflows/telegram-uploader.yml b/.github/workflows/telegram-uploader.yml index f1f9bc2..20a3ac7 100644 --- a/.github/workflows/telegram-uploader.yml +++ b/.github/workflows/telegram-uploader.yml @@ -2,6 +2,18 @@ name: Telegram Upload on: workflow_dispatch: + workflow_call: + secrets: + TELEGRAM_API_ID: + required: true + TELEGRAM_API_HASH: + required: true + TELEGRAM_BOT_TOKEN: + required: true + TELEGRAM_CHAT_ID: + required: true + STICKER_ID: + required: true jobs: tg-upload: