Bump com.google.api:api-common from 1.8.1 to 2.38.0 in /plugins/repository-gcs #172
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Label PR with Linked Issue Labels | |
on: | |
pull_request: | |
types: [opened] | |
jobs: | |
label_pr_with_issue_labels: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Get linked issue number | |
id: extract_issue | |
run: echo "::set-output name=issue_number::$(jq -r '.issue.number' $GITHUB_EVENT_PATH)" | |
- name: Get issue labels | |
id: extract_labels | |
run: | | |
token=$GITHUB_TOKEN | |
issue_number=${{ steps.extract_issue.outputs.issue_number }} | |
labels=$(curl -s -H "Authorization: token $token" "https://api.github.com/repos/$GITHUB_REPOSITORY/issues/$issue_number/labels" | jq -r '.[].name') | |
echo "::set-output name=issue_labels::$labels" | |
- name: Label PR with issue labels | |
uses: actions/github-script@v5 | |
with: | |
github_token: ${{ secrets.GH_TOKEN }} | |
script: | | |
const issueLabels = "${{ steps.extract_labels.outputs.issue_labels }}".split("\n").filter(Boolean); | |
const prNumber = context.payload.pull_request.number; | |
await github.issues.addLabels({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
issue_number: prNumber, | |
labels: issueLabels | |
}); | |