From aeb1fa82092f0efe6a258e836bad0c6df6404a34 Mon Sep 17 00:00:00 2001 From: Marion Date: Thu, 15 Feb 2024 09:09:14 -0800 Subject: [PATCH 1/4] Update candig-dispatch.yml --- .github/workflows/candig-dispatch.yml | 38 ++++++++++++++++++--------- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/.github/workflows/candig-dispatch.yml b/.github/workflows/candig-dispatch.yml index a5df4832..b78fc568 100644 --- a/.github/workflows/candig-dispatch.yml +++ b/.github/workflows/candig-dispatch.yml @@ -1,27 +1,39 @@ -name: Dispatch +name: Submodule PR on: push: branches: [develop] jobs: - CanDIG-dispatch: - runs-on: ubuntu-latest - env: - PARENT_REPOSITORY: 'CanDIG/CanDIGv2' - CHECKOUT_BRANCH: 'develop' - PR_AGAINST_BRANCH: 'develop' - OWNER: 'CanDIG' - steps: + CanDIG-dispatch: + runs-on: ubuntu-latest + env: + PARENT_REPOSITORY: 'CanDIG/CanDIGv2' + CHECKOUT_BRANCH: 'develop' + PR_AGAINST_BRANCH: 'develop' + 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/candig-data-portal/candig-data-portal - label: Submodule update From 44f224c00841f6151c6891b9e6d308c0b9a9f74c Mon Sep 17 00:00:00 2001 From: Marion Date: Thu, 15 Feb 2024 09:21:36 -0800 Subject: [PATCH 2/4] add hyphen to pass prettier --- .github/workflows/candig-dispatch.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/candig-dispatch.yml b/.github/workflows/candig-dispatch.yml index b78fc568..bd556a5d 100644 --- a/.github/workflows/candig-dispatch.yml +++ b/.github/workflows/candig-dispatch.yml @@ -1,4 +1,4 @@ -name: Submodule PR +name: Submodule-PR on: push: branches: [develop] From 972f579f61122ba153a6219303d3c412da373a7d Mon Sep 17 00:00:00 2001 From: Marion Date: Thu, 15 Feb 2024 09:28:26 -0800 Subject: [PATCH 3/4] ignore gh actions file --- .prettierignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .prettierignore diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 00000000..4536d42c --- /dev/null +++ b/.prettierignore @@ -0,0 +1 @@ +.github/workflows/candig-dispatch.yml From 311ae343fb668d43357cf847ba03d9e4d3f8b9b8 Mon Sep 17 00:00:00 2001 From: Marion Date: Thu, 15 Feb 2024 09:30:02 -0800 Subject: [PATCH 4/4] remove dash --- .github/workflows/candig-dispatch.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/candig-dispatch.yml b/.github/workflows/candig-dispatch.yml index bd556a5d..b78fc568 100644 --- a/.github/workflows/candig-dispatch.yml +++ b/.github/workflows/candig-dispatch.yml @@ -1,4 +1,4 @@ -name: Submodule-PR +name: Submodule PR on: push: branches: [develop]