diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cef22ac..bffd3e4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,18 +1,34 @@ name: telegram message on: [push] jobs: + # Tests the working-tree Dockerfile and entrypoint.sh; the build job below + # runs against the published image referenced by action.yml instead. + local-image: + name: Test local image build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + + - name: build image from working tree + run: docker build -t telegram-action:local . + + - name: send message via local image + env: + TELEGRAM_TO: ${{ secrets.TELEGRAM_TO }} + TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }} + run: | + docker run --rm \ + -e INPUT_TO="$TELEGRAM_TO" \ + -e INPUT_TOKEN="$TELEGRAM_TOKEN" \ + -e INPUT_MESSAGE_THREAD_ID= \ + -e INPUT_MESSAGE="ci: local image smoke test for ${{ github.sha }}" \ + telegram-action:local + build: name: Build runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 - - name: send custom message with args - uses: ./ - with: - to: ${{ secrets.TELEGRAM_TO }} - token: ${{ secrets.TELEGRAM_TOKEN }} - args: The ${{ github.event_name }} event triggered first step. - - name: send message using with uses: ./ with: