Skip to content

Pull Request

Pull Request #13

Workflow file for this run

name: pull_request
run-name: Pull Request
on:
pull_request:
types: [opened, synchronize, reopened, closed]
# Prevent running concurrently
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
GH_TOKEN: ${{ github.token }}
jobs:
get_changed_files:
name: Get changed files
runs-on: ubuntu-latest
outputs:
changed_files: ${{ steps.changed_files.outputs.changed_files }}
changed_python_files: ${{ steps.changed_files.outputs.changed_python_files }}
changed_yaml_files: ${{ steps.changed_files.outputs.changed_yaml_files }}
changed_json_files: ${{ steps.changed_files.outputs.changed_json_files }}
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.head_ref || github.ref }}
- name: GH CLI Version
run: gh --version
- name: Get changed files
id: changed_files
shell: bash
run: |
changed_files=`gh pr diff ${{ github.event.number }} --name-only | xargs`
echo $changed_files
echo "changed_files=$changed_files" >> $GITHUB_OUTPUT
- name: Get changed python files
id: changed_python_files
shell: bash
run: |
changed_python_files=`${{ github.workspace}}/deploy/_filter_files.py py ${{ steps.changed_files.outputs.changed_files }}`
echo $changed_python_files
echo "changed_python_files=$changed_python_files" >> $GITHUB_OUTPUT
- name: Get changed yaml files
id: changed_yaml_files
shell: bash
run: |
changed_yaml_files=`${{ github.workspace}}/deploy/_filter_files.py yml ${{ steps.changed_files.outputs.changed_files }}`
echo $changed_yaml_files
echo "changed_yaml_files=$changed_yaml_files" >> $GITHUB_OUTPUT
- name: Get changed json files
id: changed_json_files
shell: bash
run: |
changed_json_files=`${{ github.workspace}}/deploy/_filter_files.py json ${{ steps.changed_files.outputs.changed_files }}`
echo $changed_json_files
echo "changed_json_files=$changed_json_files" >> $GITHUB_OUTPUT
echo_changed_files:
needs: get_changed_files
name: Echo changed files
runs-on: ubuntu-latest
steps:
- name: Echo changed files
run: |
echo
echo "Summary of changed files:"
echo " Total changed files:"
echo "${{ needs.get_changed_files.outputs.changed_files }}" | tr ' ' '\n' | wc -l
echo
echo " Changed python files:"
echo "${{ needs.get_changed_files.outputs.changed_python_files }}" | tr ' ' '\n'
echo
echo " Changed yaml files:"
echo "${{ needs.get_changed_files.outputs.changed_yaml_files }}" | tr ' ' '\n'
echo
echo " Changed json files:"
echo "${{ needs.get_changed_files.outputs.changed_json_files }}" | tr ' ' '\n'
# format:
# name: Check format of python
# needs: get_changed_files
# uses: ./.github/workflows/format.yml
# with:
# files: ${{ needs.get_changed_files.outputs.changed_files }}
# lint:
# name: Lint python
# needs: get_changed_files
# uses: ./.github/workflows/lint.yml
# with:
# files: ${{ needs.get_changed_files.outputs.changed_files }}
# run_tests:
# name: Run tests
# uses: ./.github/workflows/tests.yml