Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@ downstream steps.
enable the `external_deploy` operation scope for it.
2. Store the key in your repository or organisation secrets:
`Settings > Secrets > Actions > New secret`, name it `REOCLO_API_KEY`.
3. Ensure the containers you want to sync are registered as Reoclo Applications
with matching `linked_container_name` values.
3. Bind the containers you want to sync to Reoclo Applications. Either label the
service with `reoclo.app: <application-slug>` (recommended — identity is
independent of the container name), or register the Application with a
matching `linked_container_name` (and optionally `linked_container_names`
aliases or a `linked_container_name_pattern` glob).

## Usage

Expand Down
13 changes: 9 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ runs:
- name: Ensure reoclo CLI
shell: bash
env:
REOCLO_PIN: v0.44.3
REOCLO_PIN: v0.45.0
# SHA-256 of the pinned release's install.sh (stable across releases). The
# installer then verifies the downloaded binary against SHA256SUMS, so this
# gives a tamper-evident chain: pinned hash -> installer -> binary.
Expand Down Expand Up @@ -84,8 +84,13 @@ runs:
echo "synced_fqdns=$(printf '%s' "$out" | jq -r '(.synced_fqdns // []) | join(",")')"
} >> "$GITHUB_OUTPUT"

# Write step summary
if [ -n "${GITHUB_STEP_SUMMARY:-}" ]; then
# Write step summary — only when the CLI returned parseable JSON. A
# failed run (e.g. a 400 from session creation) writes its error to
# stderr and nothing to stdout, leaving "$out" empty; rendering the table
# then made `jq` choke and `[ "$errors_count" -gt 0 ]` print a spurious
# "integer expression expected". Skip the table in that case — the CLI's
# stderr already carries the real error and we still `exit $rc` below.
if [ -n "${GITHUB_STEP_SUMMARY:-}" ] && printf '%s' "$out" | jq -e . >/dev/null 2>&1; then
{
echo "## Reoclo Deploy Sync"
echo ""
Expand All @@ -98,7 +103,7 @@ runs:
"| \(.container_name) | \(.status) | \((.synced_fqdns // []) | join(", ") | if . == "" then "-" else . end) | \(.reason // "-") |"
'
errors_count="$(printf '%s' "$out" | jq -r '(.errors // []) | length')"
if [ "$errors_count" -gt 0 ]; then
if [ "${errors_count:-0}" -gt 0 ]; then
echo ""
echo "### Errors"
printf '%s' "$out" | jq -r '.errors[]? | "- **\(.container_name)**: \(.reason)"'
Expand Down
Loading