-
Notifications
You must be signed in to change notification settings - Fork 60
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
Can we add option to add label on the PR? #71
Comments
The idea of GitHub actions is to be modular - so why not just use https://github.com/actions-ecosystem/action-add-labels? |
Ahh perfect, thank you for that. |
@vsoch is it at all possible that we could get an example? Very fresh to GHA, in a perfect world I would love it if somhow I could chain the label add as the second job/step(?) inside the yml action file I made that creates my PR's... To take this even one step further, I had planned on using this with If it helps, you can see the repo here: https://github.com/falconmick/blog |
I haven't tested this, but you'd want to define another name: Pull Request on Branch Push
on:
# change your trigger to be what is appropriate for you here
pull_request: []
jobs:
auto-pull-request:
name: PullRequestAction
runs-on: ubuntu-latest
steps:
- name: pull-request-action
id: pull_request
uses: vsoch/pull-request-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH_PREFIX: "update/"
PULL_REQUEST_BRANCH: "master"
PULL_REQUEST_REVIEWERS: vsoch
- name: Test outputs
env:
pull_request_number_output: ${{ steps.pull_request.outputs.pull_request_number }}
pull_request_url_output: ${{ steps.pull_request.outputs.pull_request_url }}
run: |
echo "Pull request number from output: ${pull_request_number_output}"
echo "Pull request url from output: ${pull_request_url_output}"
echo "Pull request number from environment: ${PULL_REQUEST_NUMBER}"
echo "Pull request url from environment: ${PULL_REQUEST_URL}"
echo "Another way to specify from output ${{ steps.pull_request.outputs.pull_request_number }}"
- name: Add labels
uses: actions-ecosystem/action-add-labels@v1
with:
number: ${{ steps.pull_request.outputs.pull_request_number }}
labels: bug And the "test outputs" is just there to do exactly that - you can remove when it's working for you. |
Awesome I’ll give this a go |
I think this will be very useful when creating PR and we want to label them as release, regression, testing, etc.
The text was updated successfully, but these errors were encountered: