From 9f76ac57f19a26b728b3556a436bdb07421d1dda Mon Sep 17 00:00:00 2001 From: Sam Donald <32623552+mudlabs@users.noreply.github.com> Date: Fri, 23 Oct 2020 08:47:47 +1100 Subject: [PATCH 01/20] Update action.js --- action.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/action.js b/action.js index fe8a8bf..8490fa1 100644 --- a/action.js +++ b/action.js @@ -28,6 +28,8 @@ const toBoolean = value => value.toLowerCase() == "true"; const target = normalise(path); const files = response.data.files; + console.log("Target file", target); + files.forEach(file => console.log(file.contents_url, file.contents_url.indexOf(`contents/${target}`); const file = files.find(file => file.contents_url.indexOf(`contents/${target}`) !== -1); if (file) { From 78754180afc1b1550cfa40d99370812eb84c28e2 Mon Sep 17 00:00:00 2001 From: Sam Donald <32623552+mudlabs@users.noreply.github.com> Date: Fri, 23 Oct 2020 08:48:28 +1100 Subject: [PATCH 02/20] Create File(9th edition).xml --- File(9th edition).xml | 1 + 1 file changed, 1 insertion(+) create mode 100644 File(9th edition).xml diff --git a/File(9th edition).xml b/File(9th edition).xml new file mode 100644 index 0000000..afe7d24 --- /dev/null +++ b/File(9th edition).xml @@ -0,0 +1 @@ + From 0b0cecf761f27058adfa0e9dce24979116f8c02a Mon Sep 17 00:00:00 2001 From: Sam Donald <32623552+mudlabs@users.noreply.github.com> Date: Fri, 23 Oct 2020 08:49:40 +1100 Subject: [PATCH 03/20] Update action.js --- action.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.js b/action.js index 8490fa1..6d0894c 100644 --- a/action.js +++ b/action.js @@ -29,7 +29,7 @@ const toBoolean = value => value.toLowerCase() == "true"; const target = normalise(path); const files = response.data.files; console.log("Target file", target); - files.forEach(file => console.log(file.contents_url, file.contents_url.indexOf(`contents/${target}`); + files.forEach(file => console.log(file.contents_url, file.contents_url.indexOf(`contents/${target}`))); const file = files.find(file => file.contents_url.indexOf(`contents/${target}`) !== -1); if (file) { From 9aa44b7c8b704088d53ce385b4d0ec540c29109f Mon Sep 17 00:00:00 2001 From: Sam Donald <32623552+mudlabs@users.noreply.github.com> Date: Fri, 23 Oct 2020 08:50:15 +1100 Subject: [PATCH 04/20] Update File(9th edition).xml --- File(9th edition).xml | 1 + 1 file changed, 1 insertion(+) diff --git a/File(9th edition).xml b/File(9th edition).xml index afe7d24..f092d4e 100644 --- a/File(9th edition).xml +++ b/File(9th edition).xml @@ -1 +1,2 @@ + From 0d33b5dfa561c9c12afe8c49f8aa3af059c2d686 Mon Sep 17 00:00:00 2001 From: Sam Donald <32623552+mudlabs@users.noreply.github.com> Date: Fri, 23 Oct 2020 08:59:30 +1100 Subject: [PATCH 05/20] Update action.js --- action.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/action.js b/action.js index 6d0894c..283c88b 100644 --- a/action.js +++ b/action.js @@ -29,7 +29,13 @@ const toBoolean = value => value.toLowerCase() == "true"; const target = normalise(path); const files = response.data.files; console.log("Target file", target); - files.forEach(file => console.log(file.contents_url, file.contents_url.indexOf(`contents/${target}`))); + files.forEach(file => { + console.log(file.contents_url); + console.log(file.contents_url.indexOf(`contents/${target}`)); + const d = decodeURI(file.contents_url); + console.log(d); + console.log(d.indexOf(`contents/${target}`); + }); const file = files.find(file => file.contents_url.indexOf(`contents/${target}`) !== -1); if (file) { From b08d1185643669b4596d3ae2011929c7e2280b97 Mon Sep 17 00:00:00 2001 From: Sam Donald <32623552+mudlabs@users.noreply.github.com> Date: Fri, 23 Oct 2020 08:59:45 +1100 Subject: [PATCH 06/20] Update File(9th edition).xml --- File(9th edition).xml | 1 - 1 file changed, 1 deletion(-) diff --git a/File(9th edition).xml b/File(9th edition).xml index f092d4e..afe7d24 100644 --- a/File(9th edition).xml +++ b/File(9th edition).xml @@ -1,2 +1 @@ - From 6844ca8234bb16a6deda6a82f6b1783c8d65e727 Mon Sep 17 00:00:00 2001 From: Sam Donald <32623552+mudlabs@users.noreply.github.com> Date: Fri, 23 Oct 2020 09:01:18 +1100 Subject: [PATCH 07/20] Update action.js --- action.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/action.js b/action.js index 283c88b..dcff9ca 100644 --- a/action.js +++ b/action.js @@ -32,9 +32,9 @@ const toBoolean = value => value.toLowerCase() == "true"; files.forEach(file => { console.log(file.contents_url); console.log(file.contents_url.indexOf(`contents/${target}`)); - const d = decodeURI(file.contents_url); + const d = decodeURIComponent(file.contents_url); console.log(d); - console.log(d.indexOf(`contents/${target}`); + console.log(d.indexOf(`contents/${target}`)); }); const file = files.find(file => file.contents_url.indexOf(`contents/${target}`) !== -1); From e651930d809e4f9fedb8dea071ccb71b12671a72 Mon Sep 17 00:00:00 2001 From: Sam Donald <32623552+mudlabs@users.noreply.github.com> Date: Fri, 23 Oct 2020 09:02:07 +1100 Subject: [PATCH 08/20] Update File(9th edition).xml --- File(9th edition).xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/File(9th edition).xml b/File(9th edition).xml index afe7d24..27e908a 100644 --- a/File(9th edition).xml +++ b/File(9th edition).xml @@ -1 +1 @@ - + From 1310739d5fe9b524b062f9174ce3c97792d2e605 Mon Sep 17 00:00:00 2001 From: Sam Donald <32623552+mudlabs@users.noreply.github.com> Date: Fri, 23 Oct 2020 09:03:45 +1100 Subject: [PATCH 09/20] Update test.yaml --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 178242b..3dd2c6e 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -14,7 +14,7 @@ jobs: id: diff uses: ./ with: - path: README.md + path: "Funding(9th edition).xml" strict: false - run: | echo "${{ steps.diff.outputs.added }}" From be40b4476cf915db9a2d42d5a46c02b8e47f48ee Mon Sep 17 00:00:00 2001 From: Sam Donald <32623552+mudlabs@users.noreply.github.com> Date: Fri, 23 Oct 2020 09:04:01 +1100 Subject: [PATCH 10/20] Update File(9th edition).xml --- File(9th edition).xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/File(9th edition).xml b/File(9th edition).xml index 27e908a..afe7d24 100644 --- a/File(9th edition).xml +++ b/File(9th edition).xml @@ -1 +1 @@ - + From a95f20d41347dde128c29a0fa6234f0caf42af3c Mon Sep 17 00:00:00 2001 From: Sam Donald <32623552+mudlabs@users.noreply.github.com> Date: Fri, 23 Oct 2020 09:05:01 +1100 Subject: [PATCH 11/20] Rename File(9th edition).xml to Funding(9th edition).xml --- File(9th edition).xml => Funding(9th edition).xml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename File(9th edition).xml => Funding(9th edition).xml (100%) diff --git a/File(9th edition).xml b/Funding(9th edition).xml similarity index 100% rename from File(9th edition).xml rename to Funding(9th edition).xml From 598f3e19c6e95a3eb419b129a54b1692ae75d875 Mon Sep 17 00:00:00 2001 From: Sam Donald <32623552+mudlabs@users.noreply.github.com> Date: Fri, 23 Oct 2020 09:11:00 +1100 Subject: [PATCH 12/20] Update action.js --- action.js | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/action.js b/action.js index dcff9ca..b9d1ef6 100644 --- a/action.js +++ b/action.js @@ -28,26 +28,16 @@ const toBoolean = value => value.toLowerCase() == "true"; const target = normalise(path); const files = response.data.files; - console.log("Target file", target); - files.forEach(file => { - console.log(file.contents_url); - console.log(file.contents_url.indexOf(`contents/${target}`)); - const d = decodeURIComponent(file.contents_url); - console.log(d); - console.log(d.indexOf(`contents/${target}`)); - }); - const file = files.find(file => file.contents_url.indexOf(`contents/${target}`) !== -1); + const file = files.find(file => decodeURIComponent(file.contents_url).indexOf(`contents/${target}`) !== -1); - if (file) { - core.setOutput("added", file.status === "added"); - core.setOutput("modified", file.status === "modified"); - core.setOutput("removed", file.status === "removed"); - core.setOutput("renamed", false.status === "renamed"); - core.setOutput("name", file.filename); - return; - } + core.setOutput("added", file ? file.status === "added" : false); + core.setOutput("modified", file ? file.status === "modified" : false); + core.setOutput("removed", file ? file.status === "removed" : false); + core.setOutput("renamed", file ? file.status === "renamed" : false); + core.setOutput("name", file ? file.filename : target); - if (strict === true) throw `None of the files in this commits diff tree match the provided file (${path}).`; + if (file) return; + if (strict) throw `None of the files in this commits diff tree match the provided file (${path}).`; console.log(`None of the files in this commits diff tree match the provided file (${path}).`); } catch (error) { From 1507c544ef0c387101d8188a8ad6361927ecbc26 Mon Sep 17 00:00:00 2001 From: Sam Donald <32623552+mudlabs@users.noreply.github.com> Date: Fri, 23 Oct 2020 09:11:20 +1100 Subject: [PATCH 13/20] Update Funding(9th edition).xml --- Funding(9th edition).xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Funding(9th edition).xml b/Funding(9th edition).xml index afe7d24..b3e512a 100644 --- a/Funding(9th edition).xml +++ b/Funding(9th edition).xml @@ -1 +1 @@ - + From 5001ce7290653aeab19f294c0e4255d127e12933 Mon Sep 17 00:00:00 2001 From: Sam Donald <32623552+mudlabs@users.noreply.github.com> Date: Fri, 23 Oct 2020 09:13:26 +1100 Subject: [PATCH 14/20] Update test.yaml --- .github/workflows/test.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 3dd2c6e..53bc066 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -17,8 +17,8 @@ jobs: path: "Funding(9th edition).xml" strict: false - run: | - echo "${{ steps.diff.outputs.added }}" - echo "${{ steps.diff.outputs.modified }}" - echo "${{ steps.diff.outputs.removed }}" - echo "${{ steps.diff.outputs.renamed }}" - echo "${{ steps.diff.outputs.name }}" + echo "Added? ${{ steps.diff.outputs.added }}" + echo "Modified? ${{ steps.diff.outputs.modified }}" + echo "Removed? ${{ steps.diff.outputs.removed }}" + echo "Renamed? ${{ steps.diff.outputs.renamed }}" + echo "Name: ${{ steps.diff.outputs.name }}" From cb8d0af6f011d60724edf713144beb4948236ba3 Mon Sep 17 00:00:00 2001 From: Sam Donald <32623552+mudlabs@users.noreply.github.com> Date: Fri, 23 Oct 2020 09:13:41 +1100 Subject: [PATCH 15/20] Delete Funding(9th edition).xml --- Funding(9th edition).xml | 1 - 1 file changed, 1 deletion(-) delete mode 100644 Funding(9th edition).xml diff --git a/Funding(9th edition).xml b/Funding(9th edition).xml deleted file mode 100644 index b3e512a..0000000 --- a/Funding(9th edition).xml +++ /dev/null @@ -1 +0,0 @@ - From 43478a2e75cae8c4c6cd2ed4d78bd533393fb067 Mon Sep 17 00:00:00 2001 From: Sam Donald <32623552+mudlabs@users.noreply.github.com> Date: Fri, 23 Oct 2020 09:14:47 +1100 Subject: [PATCH 16/20] Create Funding(9th edition).xml --- Funding(9th edition).xml | 1 + 1 file changed, 1 insertion(+) create mode 100644 Funding(9th edition).xml diff --git a/Funding(9th edition).xml b/Funding(9th edition).xml new file mode 100644 index 0000000..6a69f92 --- /dev/null +++ b/Funding(9th edition).xml @@ -0,0 +1 @@ +f From a300f32915b0456801c5a040451b98dbc6b5f6ec Mon Sep 17 00:00:00 2001 From: Sam Donald <32623552+mudlabs@users.noreply.github.com> Date: Fri, 23 Oct 2020 09:15:02 +1100 Subject: [PATCH 17/20] Rename Funding(9th edition).xml to Funding(10th edition).xml --- Funding(9th edition).xml => Funding(10th edition).xml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Funding(9th edition).xml => Funding(10th edition).xml (100%) diff --git a/Funding(9th edition).xml b/Funding(10th edition).xml similarity index 100% rename from Funding(9th edition).xml rename to Funding(10th edition).xml From 78dd4579278a97fea8231e25dda1b52e8815d70c Mon Sep 17 00:00:00 2001 From: Sam Donald <32623552+mudlabs@users.noreply.github.com> Date: Fri, 23 Oct 2020 09:15:10 +1100 Subject: [PATCH 18/20] Rename Funding(10th edition).xml to Funding(9th edition).xml --- Funding(10th edition).xml => Funding(9th edition).xml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Funding(10th edition).xml => Funding(9th edition).xml (100%) diff --git a/Funding(10th edition).xml b/Funding(9th edition).xml similarity index 100% rename from Funding(10th edition).xml rename to Funding(9th edition).xml From c69ca3585b56b837732e94d7bf63241f95b3107d Mon Sep 17 00:00:00 2001 From: Sam Donald <32623552+mudlabs@users.noreply.github.com> Date: Fri, 23 Oct 2020 09:18:20 +1100 Subject: [PATCH 19/20] Update test.yaml --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 53bc066..1945cc9 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -14,7 +14,7 @@ jobs: id: diff uses: ./ with: - path: "Funding(9th edition).xml" + path: README.md strict: false - run: | echo "Added? ${{ steps.diff.outputs.added }}" From 509b82d43dd9b459c1980500c20110a56a66106c Mon Sep 17 00:00:00 2001 From: Sam Donald <32623552+mudlabs@users.noreply.github.com> Date: Fri, 23 Oct 2020 09:19:16 +1100 Subject: [PATCH 20/20] Delete Funding(9th edition).xml --- Funding(9th edition).xml | 1 - 1 file changed, 1 deletion(-) delete mode 100644 Funding(9th edition).xml diff --git a/Funding(9th edition).xml b/Funding(9th edition).xml deleted file mode 100644 index 6a69f92..0000000 --- a/Funding(9th edition).xml +++ /dev/null @@ -1 +0,0 @@ -f