Skip to content

Pull Request

Pull Request #35

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 }}
python_files: ${{ steps.changed_python_files.outputs.changed_files }}
changed_yaml_files: ${{ steps.changed_yaml_files.outputs.changed_files }}
changed_json_files: ${{ steps.changed_json_files.outputs.changed_files }}
test_value: ${{ steps.test_value.outputs.test_value }}
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.head_ref || github.ref }}
- name: Get changed files
id: changed_files
shell: bash
run: |
changed_files=`gh pr diff ${{ github.event.number }} --name-only | xargs`
echo "Changed files: $changed_files"
echo "changed_files=$changed_files" >> $GITHUB_OUTPUT
- name: Get changed python files
id: changed_python_files
shell: bash
run: |
changed_files=`python3 ${{ github.workspace }}/deploy/_filter_files.py py ${{ steps.changed_files.outputs.changed_files }}`
echo "Changed python files: $changed_files"
echo "python_files=$changed_files" >> $GITHUB_OUTPUT
- name: Get changed yaml files
id: changed_yaml_files
shell: bash
run: |
changed_files=`python3 ${{ github.workspace }}/deploy/_filter_files.py yml ${{ steps.changed_files.outputs.changed_files }}`
echo "Changed yaml files: $changed_files"
echo "changed_yaml_files=$changed_files" >> $GITHUB_OUTPUT
- name: Get changed json files
id: changed_json_files
shell: bash
run: |
cjf=`python3 ${{ github.workspace }}/deploy/_filter_files.py json ${{ steps.changed_files.outputs.changed_files }}`
echo "Changed json files: $cjf"
echo "changed_json_files=$cjf" >> $GITHUB_OUTPUT
- name: Get test value
id: test_value
shell: bash
run: |
echo "test_value=foo" >> $GITHUB_OUTPUT
echo_changed_files:
needs: get_changed_files
name: Echo changed files
runs-on: ubuntu-latest
steps:
- name: Echo changed files
env:
OUTPUTS: ${{ toJson(needs) }}
run: |
echo "All outputs: $OUTPUTS"
# 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