Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[EDIT 3] update workflow-tester55 #38

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
15 changes: 9 additions & 6 deletions .github/workflows/workflow-tester55.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,33 @@ 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) }}
run: echo "$GITHUB_CONTEXT"

job2:
runs-on: ubuntu-latest
if: github.event.pull_request.edited == true
if: github.event.action == 'edited'
steps:
- run: |
echo "Pull Request EDITED"
echo ${{ github.event }}

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 }}
echo ${{ github.event }}
34 changes: 34 additions & 0 deletions .github/workflows/workflow-tester57.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
- name: Check if *.csv is modified
uses: dorny/[email protected]
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"