Skip to content

Refactor action.yml to use $GITHUB_ACTION_PATH for script execution a… #3

Refactor action.yml to use $GITHUB_ACTION_PATH for script execution a…

Refactor action.yml to use $GITHUB_ACTION_PATH for script execution a… #3

Workflow file for this run

name: Smoke test (live)
# End-to-end test against a real (staging) Self-Host Pro instance: upload an
# artifact, then finalize. It is GATED — it no-ops unless SHP_TOKEN is set, so
# forks and pull requests without secrets pass cleanly.
#
# Configure on the repo:
# Secrets: SHP_EMAIL, SHP_TOKEN
# Variables: SHP_BASE_URL, SHP_TEAM, SHP_PRODUCT, SHP_CHANNEL (optional)
on:
workflow_dispatch:
push:
branches: [main]
permissions:
contents: read
jobs:
smoke:
name: upload → finalize
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check for required secrets
id: guard
env:
SHP_TOKEN: ${{ secrets.SHP_TOKEN }}
run: |
if [ -n "$SHP_TOKEN" ]; then
echo "ready=true" >> "$GITHUB_OUTPUT"
else
echo "ready=false" >> "$GITHUB_OUTPUT"
echo "::notice::SHP_TOKEN is not configured — skipping the live smoke test."
fi
- name: Create a tiny test artifact
if: steps.guard.outputs.ready == 'true'
run: echo "ci build ${{ github.run_number }}" > SmokeTest.txt
- name: Upload artifact
if: steps.guard.outputs.ready == 'true'
id: upload
uses: ./
with:
command: upload
base_url: ${{ vars.SHP_BASE_URL }}
team: ${{ vars.SHP_TEAM }}
product: ${{ vars.SHP_PRODUCT }}
email: ${{ secrets.SHP_EMAIL }}
token: ${{ secrets.SHP_TOKEN }}
file: SmokeTest.txt
os: linux
arch: x64
version: 0.0.0-ci.${{ github.run_number }}
- name: Finalize release
if: steps.guard.outputs.ready == 'true'
id: finalize
uses: ./
with:
command: finalize
base_url: ${{ vars.SHP_BASE_URL }}
team: ${{ vars.SHP_TEAM }}
product: ${{ vars.SHP_PRODUCT }}
email: ${{ secrets.SHP_EMAIL }}
token: ${{ secrets.SHP_TOKEN }}
version: 0.0.0-ci.${{ github.run_number }}
publish: true
channel: ${{ vars.SHP_CHANNEL }}
- name: Assert outputs
if: steps.guard.outputs.ready == 'true'
run: |
echo "Uploaded artifact id: ${{ steps.upload.outputs.artifact_id }}"
echo "Final release status: ${{ steps.finalize.outputs.release_status }}"
test "${{ steps.finalize.outputs.release_status }}" = "published"