Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/actions/add-team-label/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,18 @@ inputs:
description: 'GitHub token with access to read topology.json and add labels to PRs.'
required: true

planning-token:
description: 'GitHub token with access to read topology.json. Optional if team-label-token already has this access.'
required: false

runs:
using: composite
steps:
# Fetch the team label for the PR author from topology.json and expose it as a step output.
- name: Get team label
id: get-team-label
env:
GH_TOKEN: ${{ inputs.team-label-token }}
GH_TOKEN: ${{ inputs.planning-token || inputs.team-label-token }}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this ever gonna use the team-label-token?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, if planning-token (optional) is not specified.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I mean in practice, where would this be used versus the planning-token?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It likely wouldn't, but we can't really fix that without a breaking change, and I want to avoid that (since it means bumping github-tools to v2 as a whole).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then I don't follow the change, can't we just pass in the planning token in the team-label-token parameter?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, for the job below it 🤔

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, token-exchange-service doesn't let us create a single token that works in both jobs.

USER: ${{ github.event.pull_request.user.login }}
shell: bash
run: |
Expand Down