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

Update support for workflow_dispatch #51

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

necipallef
Copy link

Fixes #5

Comment on lines +104 to +109
echo "::warning::No successful run found for 'push' event. Checking for 'workflow_dispatch' event..."
LAST_SUCCESSFUL_RUN_ID=$(gh run list --status=success --branch="$TARGET_BRANCH" --workflow="$GITHUB_BASELINE_WORKFLOW" --event=workflow_dispatch --json=databaseId --limit=1 -q '.[] | .databaseId')
fi

if [ -z "$LAST_SUCCESSFUL_RUN_ID" ]; then
echo "::error::No successful run found on the target branch for 'push' or 'workflow_dispatch' events."

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we could add more events, can we also check for schedule events? Ran into this issue as well. Thanks!

Suggested change
echo "::warning::No successful run found for 'push' event. Checking for 'workflow_dispatch' event..."
LAST_SUCCESSFUL_RUN_ID=$(gh run list --status=success --branch="$TARGET_BRANCH" --workflow="$GITHUB_BASELINE_WORKFLOW" --event=workflow_dispatch --json=databaseId --limit=1 -q '.[] | .databaseId')
fi
if [ -z "$LAST_SUCCESSFUL_RUN_ID" ]; then
echo "::error::No successful run found on the target branch for 'push' or 'workflow_dispatch' events."
echo "::warning::No successful run found for 'push' event. Checking for 'workflow_dispatch' event..."
LAST_SUCCESSFUL_RUN_ID=$(gh run list --status=success --branch="$TARGET_BRANCH" --workflow="$GITHUB_BASELINE_WORKFLOW" --event=workflow_dispatch --json=databaseId --limit=1 -q '.[] | .databaseId')
fi
if [ -z "$LAST_SUCCESSFUL_RUN_ID" ]; then
echo "::warning::No successful run found for 'workflow_dispatch' event. Checking for 'schedule' event..."
LAST_SUCCESSFUL_RUN_ID=$(gh run list --status=success --branch="$TARGET_BRANCH" --workflow="$GITHUB_BASELINE_WORKFLOW" --event=schedule --json=databaseId --limit=1 -q '.[] | .databaseId')
fi
if [ -z "$LAST_SUCCESSFUL_RUN_ID" ]; then
echo "::error::No successful run found on the target branch for 'push' or 'workflow_dispatch' or 'schedule' events."

@@ -173,7 +173,8 @@ This action provides the following outputs:

- Currently, code coverage profiles are uploaded as GitHub artifacts which automatically expire after 90 days.
In a repository which receives changes only infrequently, this might lead to issues when trying to compare
the code coverage of a pull request with the code coverage of the main branch (see fgrosse/go-coverage-report#5).
the code coverage of a pull request with the code coverage of the main branch (see fgrosse/go-coverage-report#5).
As a workaround, consider using `workflow_dispatch`.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
As a workaround, consider using `workflow_dispatch`.
As a workaround, consider using `workflow_dispatch` or `schedule`.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot display code coverage report if artifacts from target branch have expired
2 participants