Skip to content

Update README.md

Update README.md #41

name: pull-request-and-push-to-main
on:
pull_request:
types:
- opened # default
- synchronize # default
- reopened # default
push:
branches:
- main
jobs:
option1:
runs-on: ubuntu-latest
steps:
- uses: 'actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac' # v4
- name: Set upload config
id: set-conf
run: |
if [[ "${{ github.event_name }}" = "pull_request" ]]; then
echo "ENV=dev" >> "$GITHUB_OUTPUT"
else
echo "ENV=prod" >> "$GITHUB_OUTPUT"
fi
- name: Process
run: |
echo "${{ steps.set-conf.outputs.ENV }}"
option2:
runs-on: ubuntu-latest
steps:
- uses: 'actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac' # v4
- name: Set upload config
if: github.event_name == 'pull_request'
id: set-conf-dev
run: |
echo "ENV=dev" >> "$GITHUB_OUTPUT"
- name: Set upload config
if: github.event_name == 'push'
id: set-conf-prod
run: |
echo "ENV=prod" >> "$GITHUB_OUTPUT"
- name: Process
run: |
echo "${{ steps.set-conf-dev.outputs.ENV || steps.set-conf-prod.outputs.ENV }}"