Update lts.yaml #8
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: PR Actions for LTS Branch | |
on: | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
jobs: | |
handle_pr: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check if PR target branch starts with stable- | |
if: startsWith(github.event.pull_request.base.ref, 'stable-') | |
run: echo "IS_LTS=true" >> $GITHUB_ENV | |
- name: Check if PR targets LTS branch | |
if: env.IS_LTS == 'true' | |
uses: actions/github-script@v6 | |
with: | |
github-token: ${{secrets.GITHUB_TOKEN}} | |
script: | | |
github.rest.issues.addLabels({ | |
owner: context.payload.repository.owner.login, | |
repo: context.payload.repository.name, | |
issue_number: context.payload.pull_request.number, | |
labels: ['into-lts'] | |
}); | |
- name: Request review from jenkins/release | |
if: env.IS_LTS == 'true' | |
uses: actions/github-script@v6 | |
env: | |
PR_NUMBER: ${{ github.event.workflow_run.pull_requests[0].number }} | |
with: | |
github-token: ${{secrets.GITHUB_TOKEN}} | |
script: | | |
await github.rest.pulls.requestReviewers({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
pull_number: context.payload.pull_request.number, | |
team_reviewers: ['dummy'] | |
}); |