diff --git a/.github/workflows/58-env-expressions.yml b/.github/workflows/58-env-expressions.yml new file mode 100644 index 0000000000..b62021296d --- /dev/null +++ b/.github/workflows/58-env-expressions.yml @@ -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 \ No newline at end of file diff --git a/.github/workflows/workflow-tester56.yml b/.github/workflows/workflow-tester56.yml new file mode 100644 index 0000000000..4adc79229f --- /dev/null +++ b/.github/workflows/workflow-tester56.yml @@ -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 }} \ No newline at end of file