aboutsummaryrefslogtreecommitdiff
path: root/.github/check-changed-files.js
diff options
context:
space:
mode:
authorHarsh Shandilya <me@msfjarvis.dev>2021-10-03 18:09:24 +0530
committerGitHub <noreply@github.com>2021-10-03 12:39:24 +0000
commit99586970a1d80e45eee3f99324d1d8f250747f45 (patch)
treeff81e28b65f51bda49b75590300ed35d0fb5ea2d /.github/check-changed-files.js
parent2cef6a5bb4cb4afb1b1f1b704f83c1565e441825 (diff)
Cleanup and improve CI checks (#1511)
Diffstat (limited to '.github/check-changed-files.js')
-rw-r--r--.github/check-changed-files.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/.github/check-changed-files.js b/.github/check-changed-files.js
new file mode 100644
index 00000000..10f86348
--- /dev/null
+++ b/.github/check-changed-files.js
@@ -0,0 +1,20 @@
+module.exports = async ({github, context}) => {
+ const result = await github.pulls.listFiles({
+ owner: context.payload.repository.owner.login,
+ repo: context.payload.repository.name,
+ pull_number: context.payload.number,
+ per_page: 100,
+ });
+
+ const files = result.data.filter((file) => {
+ const filename = file.filename
+ // Markdown files are not tested
+ return !filename.endsWith("md") &&
+ // Exclude YAML files as long as they are not the PR workflow itself
+ !(filename.endsWith("yml") && !filename.endsWith("pull_request.yml")) && !filename.endsWith("yaml") &&
+ // Fastlane metadata does not need tests
+ !filename.startsWith("fastlane/");
+ });
+ console.log(`Remaining changed files: ${files.map(file => file.filename)}`)
+ return files.length != 0;
+}