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

Allow specifying TARGET Run ID #26

Open
peter-crist opened this issue Jun 5, 2024 · 2 comments
Open

Allow specifying TARGET Run ID #26

peter-crist opened this issue Jun 5, 2024 · 2 comments

Comments

@peter-crist
Copy link
Contributor

Current implementation will not behave as expected in a mono-repo with multiple Go projects. It would be beneficial to allow the user to optionally specify the LAST_SUCCESSFUL_RUN_ID or default to the existing behavior below:

start_group "Download code coverage results from target branch"
LAST_SUCCESSFUL_RUN_ID=$(gh run list --status=success --branch="$TARGET_BRANCH" --workflow="$GITHUB_WORKFLOW" --event=push --json=databaseId --limit=1 -q '.[] | .databaseId')
if [ -z "$LAST_SUCCESSFUL_RUN_ID" ]; then
  echo "::error::No successful run found on the target branch"
  exit 1
fi

For example, my use case would be something like:

gh run list --status=success --branch="main" --workflow="Go" --json=displayTitle,databaseId | jq -r '.[] | select(.displayTitle | contains("go/apps/app1")) | .databaseId' | head -n 1
@peter-crist
Copy link
Contributor Author

I can create a PR from a fork for this if you'd like.

@fgrosse
Copy link
Owner

fgrosse commented Jun 13, 2024

Yes that would be great. I currently only have very limited time to maintain projects on GitHub. :)

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

No branches or pull requests

2 participants