Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .github/actions/changed-files/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Get changed files
description: Outputs a stringified JSON array of changed files for a PR
inputs:
github-token:
description: GitHub token
required: true
pattern:
description: "The glob pattern to use to check for changed files"
required: true
default: "${{ github.workspace }}/**/*"
exclude:
description: "A stringified JSON array of files to exclude"
required: false
default: "[]"
outputs:
files:
description: Stringified JSON array of changed file paths
value: ${{ steps.changed-files.outputs.files }}
runs:
using: "composite"
steps:
- name: Get changed files
id: changed-files
uses: actions/github-script@v7
env:
PATTERN: ${{ inputs.pattern }}
EXCLUDE: ${{ inputs.exclude }}
with:
github-token: ${{ inputs.github-token }}
script: |
const exclude = JSON.parse(process.env['EXCLUDE']);
const path = require('path');
const pr = context.payload.pull_request;
if (!pr) {
core.setOutput('files', JSON.stringify([]));
return;
}
const files = await github.paginate(
github.rest.pulls.listFiles,
{
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: pr.number,
per_page: 100
}
);
const results = files
.filter(f => path.matchesGlob(
f.filename, process.env['PATTERN']
) && !exclude.includes(f.filename))
.map(f => f.filename);
console.debug(results);
core.setOutput('files', JSON.stringify(results));
50 changes: 49 additions & 1 deletion .github/workflows/__all-platform-bundle.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

68 changes: 67 additions & 1 deletion .github/workflows/__analysis-kinds.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 45 additions & 1 deletion .github/workflows/__analyze-ref-input.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 49 additions & 1 deletion .github/workflows/__autobuild-action.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading