summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorHarsh Shandilya <me@msfjarvis.dev>2021-05-09 10:20:26 +0530
committerHarsh Shandilya <me@msfjarvis.dev>2021-05-09 11:52:32 +0530
commit144b120692cfcd882f4a0990f8e38a0cc750dace (patch)
tree6896243da706dd244342192e5592aa7c54638b94 /.github
parent565cd32d796f5c6a096f8602966641def1c8606f (diff)
github: cleanup and better document PR workflow skip logic
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/pull_request.yml14
1 files changed, 11 insertions, 3 deletions
diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml
index b869dffd..dbfe2e4c 100644
--- a/.github/workflows/pull_request.yml
+++ b/.github/workflows/pull_request.yml
@@ -24,9 +24,17 @@ jobs:
pull_number: context.payload.number,
per_page: 100
})
- const shouldRun = result.data.filter(f => !f.filename.endsWith(".md") || !f.filename.endsWith(".txt") || !f.filename.startsWith("contrib/") || !f.filename.endsWith(".yml")).length > 0
- console.log(shouldRun)
- return shouldRun
+ const files = result.data.filter(file =>
+ // We wanna run this if the PR workflow is modified
+ (file.filename.endsWith(".yml") && !file.filename.endsWith("pull_request.yml")) ||
+ // Changes in Markdown files don't need tests
+ file.filename.endsWith(".md") ||
+ // Changes to fastlane metadata aren't covered by tests
+ file.filename.startsWith("fastlane/")
+ )
+ // If filtered file count and source file count is equal, it means all files
+ // in this PR are skip-worthy.
+ return files.length != result.data.length
- uses: actions/setup-java@d202f5dbf7256730fb690ec59f6381650114feb2
if: ${{ steps.service-changed.outputs.result == 'true' }}