Skip to content

Getting object length? #27125

Answered by Yanjingzhu
chingc asked this question in Actions
Mar 9, 2020 · 4 comments · 2 replies
Discussion options

You must be logged in to vote

@chingc Sorry to tell you that Github Actions context and expression syntax doesn’t provide a way to get an array or object length directly. 

As a work around , use jq to get the labels object length in a “run” step (like you mentioned above), then you could set the value to an output variable by using set-output command. And check the output variable in step if condition. 

There is my example:

Replies: 4 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@dector
Comment options

@rainabba
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
5 participants