Skip to content

Does not recognize issues contained in outputs.issues #514

Closed
alt-13/github-action-check-linked-issues
#1
@alt-13

Description

@alt-13

Szenario:

  1. The action is used for checking the issue linked in the PR body when a PR is created on our beta branch. With loose-matching: true.
  2. The PR is merged into beta and triggers another action which creates/updates a PR on master/main (default branch)
    Therefore I use the action's outputs.issues to add close statements. The created PR body then contains:
The following issues will be closed after merging beta into the master with this PR:
Closes org-name/repo#1801 
Closes org-name/repo#1799 
Closes org-name/repo#1807 ​

These close statements are not accepted by nearform-actions/github-action-check-linked-issues.

Used action to update the PR body:

name: Create/Update PR with linked issues to master from issues linked to merged PRs to beta

on:
  pull_request:
    types: [closed]
    branches:
      - beta

jobs:
  check_closed_issues_and_create_or_update_pr_to_master:
    name: Get linked issues and update PR
    runs-on: ubuntu-latest
    steps:
      - name: Get linked issues
        uses: nearform-actions/github-action-check-linked-issues@v1
        id: check-linked-issues
        with:
          exclude-branches: "release/**, dependabot/**"
          loose-matching: true
      - name: Print linked issues to console
        run: echo "${{ steps.check-linked-issues.outputs.issues }}"
      - name: Checkout repository
        uses: actions/checkout@v3
        with:
          fetch-depth: 0
      - name: GitHub Action for creating Pull Requests
        uses: devops-infra/action-pull-request@v0.5.5
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          source_branch: beta
          target_branch: master
          title: New Prod Update
          body: "The following issues will be closed after merging beta into the master with this PR:​"
          old_string: "​"
          new_string: "\nCloses ${{ join(fromJSON(steps.check-linked-issues.outputs.issues), '\n Closes ') }} ​"
          get_diff: true
          ignore_users: "dependabot"
          allow_no_diff: false

Would it be possible to also accept close statements with "org-name/repo/#issue-number" as this is the output of the action?

Otherwise, I have to change the action to change the outputs.issues to either #issue-number or link to issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions