Comments (2)
AFAIK, the "outputs" of an action can only be strings (this was certainly true when actions just came out of beta? I haven't tried it since then, although this seems to support that, even though those are job outputs and not step outputs). So unfortunately we probably can't just return an array of labels.
We could set some kind of environment variable like "PR_LABEL_BUG" if the PR has the label "bug"? We're supposed to declare all the available outputs in action.yml, so we probably shouldn't define outputs like "labels_bug"... although this says outputs will be available even if you don't declare them (then why do we need to declare them in the first place?) Outputs like this are nice, because they're scoped to the action, where environment variables are not. And then you could do if: steps.findpr.outputs.labels_bug
.
We could return a comma delimited list of labels? But would this fix your use case? You could do contains( steps.findpr.outputs.labels, 'bug' )
, but then this would find PRs with the label "bug" and also PRs with the label "bugle", so it's not perfect.
from gh-find-current-pr.
Hello, I've came up with my own action in the meantime that does what I needed. I based my work off of another community GitHub action https://github.com/Dreamcodeio/does-pr-has-label
Basically I did what you were saying, return a comma-separated list of the matched PRs. But also I've included a new parameter which determines if any or all the labels must match. And then I only check the second output of the action, hasLabel
which is either true
or false
.
Anyway, I solved my own problem. Thanks for your quick response.
from gh-find-current-pr.
Related Issues (20)
- allow to set state
- Does not work with `merge_group` trigger HOT 1
- not triggered by `pull_request_target` HOT 3
- Find pr during workflow triggered by push after rebase merge
- Receive deprecated warnings at GH workflow step HOT 1
- action fails unless actions have write permissions HOT 2
- Node 16 Deprecation Warning. Upgrade to 20 HOT 2
- Output the entire pull request payload HOT 1
- Not working HOT 8
- Create license for this action? HOT 1
- Action triggered on closed PR does not seem to find the PR number correctly HOT 4
- Can I provide branch-name to find the PR number? HOT 2
- Ambiguity with `pr` or `number` outputs HOT 1
- Returns unexpected PR number when multiple PRs including same commit HOT 3
- Richer outputs HOT 5
- Does not seem to work with issue_comment event HOT 2
- Update action to use updated version of Node HOT 3
- Action returns empty string, but PR exists HOT 4
- The `set-output` command is deprecated, upgrade to Env files HOT 3
- Deprecation warning HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gh-find-current-pr.