From 4c648eeb44034587bafd3264c4c1d51444d34903 Mon Sep 17 00:00:00 2001 From: MongoCaleb Date: Tue, 23 Jul 2024 14:36:49 -0700 Subject: [PATCH 01/12] remove debug step; add dummy file to test --- .github/workflows/add-netlify-links.yml | 8 ++++---- source/foo.txt | 0 2 files changed, 4 insertions(+), 4 deletions(-) create mode 100644 source/foo.txt diff --git a/.github/workflows/add-netlify-links.yml b/.github/workflows/add-netlify-links.yml index 103e9e794..5eafc48d7 100644 --- a/.github/workflows/add-netlify-links.yml +++ b/.github/workflows/add-netlify-links.yml @@ -51,12 +51,12 @@ jobs: name: Update the PR Description needs: get-pr-changes runs-on: ubuntu-latest + permissions: + issues: write + contents: write + pull-requests: write steps: - uses: actions/checkout@v4 - - name: Debug - id: parser - run: | - echo "${{ needs.get-pr-changes.outputs.staging_links }}" - name: Update PR Description uses: nefrob/pr-description@v1.1.2 with: diff --git a/source/foo.txt b/source/foo.txt new file mode 100644 index 000000000..e69de29bb From 216915f9ce16ca171216c134af2da6c6fc0cc469 Mon Sep 17 00:00:00 2001 From: MongoCaleb Date: Tue, 23 Jul 2024 15:06:59 -0700 Subject: [PATCH 02/12] running on account within the enterprise --- .github/workflows/add-netlify-links.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/add-netlify-links.yml b/.github/workflows/add-netlify-links.yml index 5eafc48d7..d60b64cf2 100644 --- a/.github/workflows/add-netlify-links.yml +++ b/.github/workflows/add-netlify-links.yml @@ -51,15 +51,15 @@ jobs: name: Update the PR Description needs: get-pr-changes runs-on: ubuntu-latest - permissions: - issues: write - contents: write - pull-requests: write steps: - uses: actions/checkout@v4 + - name: Debug + id: parser + run: | + echo "${{ needs.get-pr-changes.outputs.staging_links }}" - name: Update PR Description uses: nefrob/pr-description@v1.1.2 with: regex: ".*?" content: ${{ needs.get-pr-changes.outputs.staging_links }} - token: ${{ secrets.GITHUB_TOKEN }} + token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From 6562fbaa51d997b45bd275703ab240488360e141 Mon Sep 17 00:00:00 2001 From: MongoCaleb Date: Mon, 5 Aug 2024 09:41:53 -0700 Subject: [PATCH 03/12] exploring regex --- .github/workflows/add-netlify-links.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/add-netlify-links.yml b/.github/workflows/add-netlify-links.yml index d60b64cf2..21b67f48d 100644 --- a/.github/workflows/add-netlify-links.yml +++ b/.github/workflows/add-netlify-links.yml @@ -60,6 +60,6 @@ jobs: - name: Update PR Description uses: nefrob/pr-description@v1.1.2 with: - regex: ".*?" + regex: "" content: ${{ needs.get-pr-changes.outputs.staging_links }} token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From c5e37baf91572c54a86eab60804e56235e37bf7b Mon Sep 17 00:00:00 2001 From: MongoCaleb Date: Mon, 5 Aug 2024 09:44:35 -0700 Subject: [PATCH 04/12] add dummy files --- source/foo.bar | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 source/foo.bar diff --git a/source/foo.bar b/source/foo.bar new file mode 100644 index 000000000..e69de29bb From 37ddc3aeaec75930a4e4b011d1f7d0e614b14363 Mon Sep 17 00:00:00 2001 From: MongoCaleb Date: Mon, 5 Aug 2024 09:45:55 -0700 Subject: [PATCH 05/12] add another dummy file --- barfoo.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 barfoo.txt diff --git a/barfoo.txt b/barfoo.txt new file mode 100644 index 000000000..e69de29bb From 023eda0f77b761077e8f28101a0a23ff008291c0 Mon Sep 17 00:00:00 2001 From: MongoCaleb Date: Mon, 5 Aug 2024 09:47:35 -0700 Subject: [PATCH 06/12] add appendContentOnMatchOnly:true --- .github/workflows/add-netlify-links.yml | 1 + baz.txt | 0 2 files changed, 1 insertion(+) create mode 100644 baz.txt diff --git a/.github/workflows/add-netlify-links.yml b/.github/workflows/add-netlify-links.yml index 21b67f48d..20df765a5 100644 --- a/.github/workflows/add-netlify-links.yml +++ b/.github/workflows/add-netlify-links.yml @@ -61,5 +61,6 @@ jobs: uses: nefrob/pr-description@v1.1.2 with: regex: "" + appendContentOnMatchOnly: true content: ${{ needs.get-pr-changes.outputs.staging_links }} token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/baz.txt b/baz.txt new file mode 100644 index 000000000..e69de29bb From 0d7fe073ea496db5c29929c55af2370d053cccd2 Mon Sep 17 00:00:00 2001 From: MongoCaleb Date: Mon, 5 Aug 2024 09:51:50 -0700 Subject: [PATCH 07/12] maybe it needs to be a string value --- .github/workflows/add-netlify-links.yml | 2 +- baz.txt | 0 source/foo.bar | 0 source/foo.txt | 0 barfoo.txt => source/newlink1.txt | 0 5 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 baz.txt delete mode 100644 source/foo.bar delete mode 100644 source/foo.txt rename barfoo.txt => source/newlink1.txt (100%) diff --git a/.github/workflows/add-netlify-links.yml b/.github/workflows/add-netlify-links.yml index 20df765a5..0379e2731 100644 --- a/.github/workflows/add-netlify-links.yml +++ b/.github/workflows/add-netlify-links.yml @@ -61,6 +61,6 @@ jobs: uses: nefrob/pr-description@v1.1.2 with: regex: "" - appendContentOnMatchOnly: true + appendContentOnMatchOnly: "true" content: ${{ needs.get-pr-changes.outputs.staging_links }} token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/baz.txt b/baz.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/source/foo.bar b/source/foo.bar deleted file mode 100644 index e69de29bb..000000000 diff --git a/source/foo.txt b/source/foo.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/barfoo.txt b/source/newlink1.txt similarity index 100% rename from barfoo.txt rename to source/newlink1.txt From fd30432adb0e8a56cfcd3efdc7e6ef63dd96ab4e Mon Sep 17 00:00:00 2001 From: MongoCaleb Date: Mon, 5 Aug 2024 09:53:13 -0700 Subject: [PATCH 08/12] new test file --- source/newlink2.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 source/newlink2.txt diff --git a/source/newlink2.txt b/source/newlink2.txt new file mode 100644 index 000000000..e69de29bb From 73a48dc94e78ea1bf1e1b19692a01a141d4fd271 Mon Sep 17 00:00:00 2001 From: MongoCaleb Date: Mon, 5 Aug 2024 10:00:26 -0700 Subject: [PATCH 09/12] try preserving placeholder --- .github/workflows/add-netlify-links.yml | 4 ++-- source/newlink3.txt | 0 2 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 source/newlink3.txt diff --git a/.github/workflows/add-netlify-links.yml b/.github/workflows/add-netlify-links.yml index 0379e2731..45f69cbe0 100644 --- a/.github/workflows/add-netlify-links.yml +++ b/.github/workflows/add-netlify-links.yml @@ -60,7 +60,7 @@ jobs: - name: Update PR Description uses: nefrob/pr-description@v1.1.2 with: - regex: "" + regex: ".*?" appendContentOnMatchOnly: "true" - content: ${{ needs.get-pr-changes.outputs.staging_links }} + content: "${{ needs.get-pr-changes.outputs.staging_links }}" token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/source/newlink3.txt b/source/newlink3.txt new file mode 100644 index 000000000..e69de29bb From 3e85e91b0d8ae5e1ecea67d606c5986f51bd0c7c Mon Sep 17 00:00:00 2001 From: MongoCaleb Date: Mon, 5 Aug 2024 10:03:36 -0700 Subject: [PATCH 10/12] add regex flags --- .github/workflows/add-netlify-links.yml | 1 + source/newlink4.txt | 0 2 files changed, 1 insertion(+) create mode 100644 source/newlink4.txt diff --git a/.github/workflows/add-netlify-links.yml b/.github/workflows/add-netlify-links.yml index 45f69cbe0..dd60c2786 100644 --- a/.github/workflows/add-netlify-links.yml +++ b/.github/workflows/add-netlify-links.yml @@ -62,5 +62,6 @@ jobs: with: regex: ".*?" appendContentOnMatchOnly: "true" + regexFlags: ims content: "${{ needs.get-pr-changes.outputs.staging_links }}" token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/source/newlink4.txt b/source/newlink4.txt new file mode 100644 index 000000000..e69de29bb From 5ebb40b9386851b25977d383f47295b26c57c8df Mon Sep 17 00:00:00 2001 From: MongoCaleb Date: Mon, 5 Aug 2024 10:09:15 -0700 Subject: [PATCH 11/12] trying different flags --- .github/pull_request_template.md | 4 +++- .github/workflows/add-netlify-links.yml | 8 ++++---- source/newlink5.txt | 0 3 files changed, 7 insertions(+), 5 deletions(-) create mode 100644 source/newlink5.txt diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 910c2b2e7..2cd8eaaf6 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -3,7 +3,9 @@ Jira ticket: https://jira.mongodb.org/browse/DOCSP-NNNNN ### Staging Links - + + + ### Reminder Checklist diff --git a/.github/workflows/add-netlify-links.yml b/.github/workflows/add-netlify-links.yml index dd60c2786..eee3ba18d 100644 --- a/.github/workflows/add-netlify-links.yml +++ b/.github/workflows/add-netlify-links.yml @@ -60,8 +60,8 @@ jobs: - name: Update PR Description uses: nefrob/pr-description@v1.1.2 with: - regex: ".*?" - appendContentOnMatchOnly: "true" - regexFlags: ims - content: "${{ needs.get-pr-changes.outputs.staging_links }}" + regex: ".*" + appendContentOnMatchOnly: true + regexFlags: is + content: "\n${{ needs.get-pr-changes.outputs.staging_links }}\n" token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/source/newlink5.txt b/source/newlink5.txt new file mode 100644 index 000000000..e69de29bb From b70cf8aa62dbfa9bf87302f7daa4542cc1131026 Mon Sep 17 00:00:00 2001 From: MongoCaleb Date: Mon, 5 Aug 2024 10:24:20 -0700 Subject: [PATCH 12/12] changing ref to locally-owned --- .github/workflows/add-netlify-links.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/add-netlify-links.yml b/.github/workflows/add-netlify-links.yml index eee3ba18d..970872596 100644 --- a/.github/workflows/add-netlify-links.yml +++ b/.github/workflows/add-netlify-links.yml @@ -58,7 +58,7 @@ jobs: run: | echo "${{ needs.get-pr-changes.outputs.staging_links }}" - name: Update PR Description - uses: nefrob/pr-description@v1.1.2 + uses: MongoCaleb/pr-description-action@master with: regex: ".*" appendContentOnMatchOnly: true