Skip to content

Commit

Permalink
Merge pull request #47 from CanDIG/mshadbolt/update-github-action
Browse files Browse the repository at this point in the history
DIG-1376 :Update GH Action to improve PR title and description
  • Loading branch information
mshadbolt authored Feb 27, 2024
2 parents 7415df6 + ffc6d86 commit 67fb5ad
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions .github/workflows/dispatch-actions.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Dispatch
name: Submodule PR
on:
push:
branches: [develop]
Expand All @@ -12,16 +12,28 @@ jobs:
OWNER: 'CanDIG'
steps:
- name: Check out repository code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: get PR data
uses: actions/github-script@v7
id: get_pr_data
with:
script: |
return (
await github.rest.repos.listPullRequestsAssociatedWithCommit({
commit_sha: context.sha,
owner: context.repo.owner,
repo: context.repo.repo,
})
).data[0];
- name: Create PR in CanDIGv2
id: make_pr
uses: jman005/github-action-pr-expanded@v0
uses: CanDIG/github-action-pr-expanded@v4
with:
github_token: ${{ secrets.SUBMODULE_PR }}
parent_repository: ${{ env.PARENT_REPOSITORY }}
checkout_branch: ${{ env.CHECKOUT_BRANCH}}
pr_against_branch: ${{ env.PR_AGAINST_BRANCH }}
pr_description: "PR triggered by update to develop branch on ${{ github.repository }}. Commit hash: ${{ github.sha }}"
pr_title: '${{ github.repository }} merging: ${{ fromJson(steps.get_pr_data.outputs.result).title }}'
pr_description: "PR triggered by update to develop branch on ${{ github.repository }}. Commit hash: `${{ github.sha }}`. PR link: [#${{ fromJson(steps.get_pr_data.outputs.result).number }}](https://github.com/${{ github.repository }}/pull/${{ fromJson(steps.get_pr_data.outputs.result).number }})"
owner: ${{ env.OWNER }}
submodule_path: lib/opa/opa
label: Submodule update

0 comments on commit 67fb5ad

Please sign in to comment.