Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-actions/github/run: Add timing info #1010

Merged
merged 1 commit into from
Nov 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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