Skip to content

Commit

Permalink
gh-actions/github/run: Add timing info (#1010)
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Northey <ryan@synca.io>
  • Loading branch information
phlax committed Nov 12, 2023
1 parent 32349f8 commit 6687c0b
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions gh-actions/github/run/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,9 @@ runs:
SOURCETMP: ${{ steps.source.outputs.file }}
shell: bash
- run: |
STARTED="$(date +%s)"
echo "started=$STARTED" >> $GITHUB_OUTPUT
cd $TARGET_PATH
if [[ -n "${SOURCETMP}" ]]; then
. "$SOURCETMP"
Expand All @@ -150,11 +151,13 @@ runs:
TMP_STDERR=$(mktemp)
echo "stderr-path=${TMP_STDERR}" >> $GITHUB_OUTPUT
read -ra COMMAND_PARTS <<< "$COMMAND"
EXIT_CODE=0
"${COMMAND_PARTS[@]}" 2> >(tee "$TMP_STDERR") || {
echo "exit-code=$?" >> $GITHUB_OUTPUT
exit 0
EXIT_CODE=$?
}
echo "exit-code=0" >> $GITHUB_OUTPUT
COMPLETED="$(date +%s)"
echo "completed=$COMPLETED" >> $GITHUB_OUTPUT
echo "exit-code=${EXIT_CODE}" >> $GITHUB_OUTPUT
shell: bash
id: run
env:
Expand Down

0 comments on commit 6687c0b

Please sign in to comment.