[Feature Update] Optional raw text support #314
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Receive PR | |
# read-only repo token | |
# no access to secrets | |
on: | |
pull_request: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Get changed files using defaults | |
id: changed-files | |
uses: tj-actions/changed-files@v23.1 | |
- name: List all changed files | |
run: | | |
for file in ${{ steps.changed-files.outputs.all_changed_and_modified_files }}; do | |
echo "$file was changed" | |
done | |
- name: Check large datasets | |
id: main | |
run: | | |
dataset_list=() | |
for path in ${{ steps.changed-files.outputs.all_changed_and_modified_files }}; do | |
dir="$(dirname "${path}")" ; | |
if [ ! -d "$dir" ]; then | |
echo "$dir doesn't exist, continue" | |
continue; | |
fi | |
dataset=$(echo $path | grep "datasets" | sed -r 's/datasets\/([_a-zA-Z0-9-]+)\/.*/\1/') | |
if [ -z "$dataset" ]; then continue; fi | |
if [[ ! " ${dataset_list[*]} " =~ " ${dataset} " ]]; then | |
echo "add dataset: $dataset" | |
dataset_list+=($dataset) | |
fi | |
done | |
dataset_to_comment=() | |
large_dataset_list=$(cat tests/config.yaml | sed -r 's/large_dataset_to_skip: \[(.*)\]/\1/') | |
for dataset in "${dataset_list[@]}"; do | |
if [[ "$large_dataset_list" == *"$dataset"* ]]; then | |
echo "add ${dataset} to dataset_to_comment" | |
dataset_to_comment+=($dataset) | |
fi | |
done | |
if [ ${#dataset_to_comment[@]} -ne 0 ]; then | |
echo "dataset to be commented are: ${dataset_to_comment[*]}" | |
fi | |
echo "::set-output name=DATASETS::${dataset_to_comment[*]}" | |
- name: Save PR number | |
run: | | |
mkdir -p ./pr | |
echo ${{ github.event.number }} > ./pr/NR | |
echo ${{ steps.main.outputs.DATASETS }} >> ./pr/NR | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: pr | |
path: pr/ |