mirror of
https://github.com/appleboy/telegram-action.git
synced 2026-10-09 12:40:42 +09:00
ci: add working-tree image test and drop dead args step
- Build and smoke-test the local Dockerfile/entrypoint since the action now runs the published ghcr image instead of the working tree - Exercise the empty INPUT_MESSAGE_THREAD_ID guard in the smoke test - Remove the args step which silently sent the default message
This commit is contained in:
@@ -1,18 +1,34 @@
|
|||||||
name: telegram message
|
name: telegram message
|
||||||
on: [push]
|
on: [push]
|
||||||
jobs:
|
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:
|
build:
|
||||||
name: Build
|
name: Build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v7
|
- 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
|
- name: send message using with
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
|
|||||||
Reference in New Issue
Block a user