Android-Password-Store/.github/check-changed-files.js
renovate[bot] c911554c84
chore(deps): update actions/github-script action to v5 (#1616)
* chore(deps): update actions/github-script action to v5

* github: update check-changed-files for OctoKit upgrade

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2021-12-23 13:20:48 +00:00

20 lines
806 B
JavaScript

module.exports = async ({github, context}) => {
const result = await github.rest.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;
}