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

use sed to avoid dependency on jq #18

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

db82407
Copy link

@db82407 db82407 commented Dec 16, 2023

This is a fix for #17 (already closed).

I was initially detecting missing jq dependency and installing it it my workflow, but this PR avoids the dependency on jq by using sed instead.

jq -r .workflow_id can be replaced by

sed -E -ne 's/."workflow_id":\s([0-9]+).*/\1/p')

jq -r .workflow_runs[0].conclusion can be replaced by

sed -E -ne '/"workflow_runs":/,/"conclusion":/ {s/."conclusion":\s"([^"])"./\1/p}')

Here the initial /"workflow_runs":/,/"conclusion":/ selects all lines from the start of the workflow_runs definition, and the rest gets the conclusion from the selected lines.

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.

1 participant