Skip to content

Commit

Permalink
add 58 env expression workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Guillaume Falourd <[email protected]>
  • Loading branch information
GuillaumeFalourd committed Sep 21, 2022
1 parent 0d3acdb commit a8ede65
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/58-env-expressions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: 58 - Env Expressions

on:
workflow_dispatch:
push:

env:
TOKEN: "${{ github.event_name == 'push' && 'TOKEN_ON_PUSH' || 'TOKEN_NOT_ON_PUSH' }}"


jobs:
job1:
runs-on: ubuntu-latest
steps:
- run: echo $TOKEN
33 changes: 33 additions & 0 deletions .github/workflows/workflow-tester56.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Test 55 #Related to SO https://stackoverflow.com/questions/73643836/prevent-a-job-in-github-action-workflow-file-to-run-in-case-of-an-event

on:
pull_request:
types: [opened, synchronize, reopened, edited]

jobs:
job1:
runs-on: ubuntu-latest
steps:
- name: Dump GitHub Event
run: echo ${{ github.event }}

- 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
steps:
- run: |
echo "Pull Request EDITED"
echo ${{ github.event }}
job3:
runs-on: ubuntu-latest
if: github.event.pull_request.edited != true
steps:
- run: |
echo "Pull Request NOT EDITED"
echo ${{ github.event }}

0 comments on commit a8ede65

Please sign in to comment.