#12774 Title and Name should be available in General Tab for all layer types that support it #2338
Workflow file for this run
This file contains hidden or 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: Backport merged pull request | |
| on: | |
| pull_request_target: | |
| types: [closed, labeled] | |
| permissions: | |
| contents: write # so it can comment | |
| pull-requests: write # so it can create pull requests | |
| jobs: | |
| backport: | |
| name: Backport pull request | |
| runs-on: ubuntu-latest | |
| # Don't run on closed unmerged pull requests | |
| if: > | |
| github.event.pull_request.merged | |
| && ( | |
| github.event.action == 'closed' | |
| || ( | |
| github.event.action == 'labeled' | |
| && contains(github.event.label.name, 'backport') | |
| ) | |
| ) | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| # Token for git actions, e.g. git push see https://github.com/korthout/backport-action/issues/379 | |
| token: ${{ secrets.BACKPORT_ACTION_PAT }} | |
| - name: Get issues | |
| id: get-issues | |
| uses: mondeja/pr-linked-issues-action@v2 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.BACKPORT_ACTION_PAT }} | |
| - name: Create backport pull requests | |
| id: create_backport_pr | |
| uses: korthout/backport-action@v4 | |
| with: | |
| # Token for git actions, see https://github.com/korthout/backport-action/issues/379 | |
| github_token: ${{ secrets.BACKPORT_ACTION_PAT }} | |
| auto_merge_method: squash | |
| auto_merge_enabled: true | |
| copy_assignees: true | |
| copy_milestone: true | |
| copy_requested_reviewers: true | |
| add_labels: Backport | |
| pull_description: |- | |
| # Description | |
| Backport of #${pull_number} to `${target_branch}`. | |
| Fixes #${{ steps.get-issues.outputs.issues }} | |
| experimental: > | |
| { | |
| "conflict_resolution": "draft_commit_conflicts" | |
| } | |
| - name: Link all backport PRs to original issue | |
| if: ${{ steps.get-issues.outputs.issues != '' && steps.create_backport_pr.outputs.created_pull_numbers != '' }} | |
| uses: actions/github-script@v7 | |
| with: | |
| github-token: ${{ secrets.BACKPORT_ACTION_PAT }} | |
| script: | | |
| const issueNumbers = "${{ steps.get-issues.outputs.issues }}".split(',').map(s => s.trim()).filter(Boolean); | |
| const prNumbers = "${{ steps.create_backport_pr.outputs.created_pull_numbers }}".split(' ').map(s => s.trim()).filter(Boolean); | |
| for (const prNumber of prNumbers) { | |
| const { data: pr } = await github.rest.pulls.get({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| pull_number: Number(prNumber) | |
| }); | |
| for (const issueNumber of issueNumbers) { | |
| const { data: issue } = await github.rest.issues.get({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: Number(issueNumber) | |
| }); | |
| console.log(`Linking PR #${prNumber} to issue #${issueNumber}`); | |
| await github.graphql(` | |
| mutation AddLinkedIssue($pullRequestId: ID!, $issueId: ID!) { | |
| addLinkedIssue(input: { | |
| pullRequestId: $pullRequestId, | |
| issueId: $issueId | |
| }) { | |
| pullRequest { | |
| number | |
| } | |
| } | |
| } | |
| `, { | |
| pullRequestId: pr.node_id, | |
| issueId: issue.node_id | |
| }); | |
| } | |
| } |