Skip to content

Commit 2249ab4

Browse files
committed
Read the existing Sample main build output once
1 parent 3216b0d commit 2249ab4

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Temporary Sample build readback
2+
3+
on:
4+
workflow_dispatch:
5+
6+
permissions:
7+
actions: read
8+
9+
jobs:
10+
readback:
11+
runs-on: ubuntu-latest
12+
timeout-minutes: 3
13+
steps:
14+
- name: Read the existing main build log
15+
env:
16+
GH_TOKEN: ${{ github.token }}
17+
shell: bash
18+
run: |
19+
set -euo pipefail
20+
log_file="$RUNNER_TEMP/sample-build-117620081555.log"
21+
trap 'rm -- "$log_file"' EXIT
22+
timeout 60s gh api repos/durable-workflow/sample-app/actions/jobs/117620081555/logs > "$log_file"
23+
echo 'Last 35 lines of existing main job 117620081555:'
24+
tail -n 35 "$log_file"
25+
while IFS= read -r line; do
26+
line="${line//'%'/'%25'}"
27+
line="${line//$'\r'/'%0D'}"
28+
line="${line//$'\n'/'%0A'}"
29+
printf '::notice title=Sample build last output::%s\n' "$line"
30+
done < <(tail -n 12 "$log_file")

0 commit comments

Comments
 (0)