diff --git a/.github/workflows/workflow-tester55.yml b/.github/workflows/workflow-tester55.yml index 4adc79229f..e4f0d60e62 100644 --- a/.github/workflows/workflow-tester55.yml +++ b/.github/workflows/workflow-tester55.yml @@ -4,13 +4,16 @@ on: pull_request: types: [opened, synchronize, reopened, edited] +# opened: when the PR is opened +# reopened: when the PR is reopened +# synchronize: when the PR description or files are edited +# edited: when editing the title + jobs: job1: runs-on: ubuntu-latest steps: - - name: Dump GitHub Event - run: echo ${{ github.event }} - + - run: echo "GITHUB ACTION:" ${{ github.event.action }} - name: Dump GitHub context env: GITHUB_CONTEXT: ${{ toJSON(github) }} @@ -18,7 +21,7 @@ jobs: job2: runs-on: ubuntu-latest - if: github.event.pull_request.edited == true + if: github.event.action == 'edited' steps: - run: | echo "Pull Request EDITED" @@ -26,8 +29,8 @@ jobs: job3: runs-on: ubuntu-latest - if: github.event.pull_request.edited != true + if: github.event.action != 'edited' steps: - run: | echo "Pull Request NOT EDITED" - echo ${{ github.event }} \ No newline at end of file + echo ${{ github.event }} diff --git a/.github/workflows/workflow-tester57.yml b/.github/workflows/workflow-tester57.yml new file mode 100644 index 0000000000..af23b64280 --- /dev/null +++ b/.github/workflows/workflow-tester57.yml @@ -0,0 +1,34 @@ +name: Test 57 #Related to SO https://stackoverflow.com/questions/73890119/gitaction-trigger-workflow-on-pr-approval-and-when-base-branch-is-main-and-csv + +on: + pull_request_review: + types: [submitted] + branches: + - main + +jobs: + job1: + if: github.event.review.state == 'approved' && startsWith(github.base_ref, 'main/') + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2.2.0 + - name: Check if *.csv is modified + uses: dorny/paths-filter@v2.2.1 + id: changes + with: + filters: | + csv: + - 'data/*.csv' + - name: Run process bmv script + if: ${{ steps.changes.outputs.csv == 'true' }} + run: | + echo "-Started running script-" + + github-context: + runs-on: ubuntu-latest + steps: + - name: Dump GitHub context + env: + GITHUB_CONTEXT: ${{ toJSON(github) }} + run: echo "$GITHUB_CONTEXT" \ No newline at end of file