Use pull_request_target in workflow as PRs are from forks #3
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: Create issue to track porting between Community and Product docs | |
on: | |
pull_request_target: | |
types: | |
- closed | |
branches: | |
- main | |
paths-ignore: | |
- '**/README.md' | |
permissions: | |
issues: write | |
pull-requests: read | |
jobs: | |
create_issue: | |
if: github.event.pull_request.merged == true && contains( github.event.pull_request.labels.*.name, 'port/community-product') | |
runs-on: ubuntu-latest | |
steps: | |
- name: Create issue | |
env: | |
GH_TOKEN: ${{ github.token }} | |
run: | | |
gh issue create \ | |
--repo rancher/rancher-docs \ | |
--title 'Port Community docs PR #${{github.event.pull_request.number}}: ${{github.event.pull_request.title}}' \ | |
--body 'Reference: https://github.com/${{github.repository}}/pull/${{github.event.pull_request.number}}' \ | |
--label port/community-product |