Skip to content

Support for output #59

@danielsht86

Description

@danielsht86

I'm using this action as one step in a multi step (job actually) workflow. I would like to have this action label PRs based on the files changed, but subsequently assign reviewers based on those labels. Here is a sample of my workflow:

name: "PR Review Assigner" on: - pull_request jobs: label: runs-on: ubuntu-latest steps: - uses: actions/labeler@v2 with: repo-token: "${{ secrets.GITHUB_TOKEN }}" configuration-path: ".github/workflows/pr-review-assign/labeler.yml" assign-reviewers: needs: label runs-on: ubuntu-latest steps: - name: "Print event" env: EVENT_CONTEXT: ${{ toJson(github.event.pull_request.labels) }} run: echo "$EVENT_CONTEXT" - name: "Assign NodeJS Review Candidate Team" if: contains(github.event.pull_request.labels.*.name, 'nodejs-pr') uses: kentaro-m/auto-assign-action@v1.1.0 with: repo-token: "${{ secrets.GITHUB_TOKEN }}" configuration-path: ".github/workflows/pr-review-assign/nodejs-pr.yml" - name: "Assign App Review Candidate Team" if: contains(github.event.pull_request.labels.*.name, 'app-pr') uses: kentaro-m/auto-assign-action@v1.1.0 with: repo-token: "${{ secrets.GITHUB_TOKEN }}" configuration-path: ".github/workflows/pr-review-assign/app-pr.yml" - name: "Assign Editor Review Candidate Team" if: contains(github.event.pull_request.labels.*.name, 'editor-pr') uses: kentaro-m/auto-assign-action@v1.1.0 with: repo-token: "${{ secrets.GITHUB_TOKEN }}" configuration-path: ".github/workflows/pr-review-assign/editor-pr.yml" 

The problem here is that the github.event.pull_request object is created before the entire workflow runs and is not updated when this specific action runs. So github.event.pull_request.labels is not affected by this action.

One solution would be for this action to produce an output of the labels changed (or better yet, the labels of the PR) so that it can be used in subsequent jobs that run sequentially.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestNew feature or request to improve the current logic

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions