Skip to content

ci: change to pull request target #22

ci: change to pull request target

ci: change to pull request target #22

Workflow file for this run

name: Package
on:
pull_request:
push:
branches:
- main
jobs:
publish:
runs-on: ubuntu-latest
name: Hello Everyone
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set Environment Variables
run: |
ref=$(git branch -r --contains ${{ github.sha }})
branch=${ref##*/}
echo -ne "GITHUB_BRANCH=$branch" >> $GITHUB_ENV
- name: test 1
run: |
echo ${{ github.event.pull_request.merged }}
echo ${{ github.event.pull_request.closed }}
echo ${{ github.event.pull_request.closed }}
echo ${{ github.head_ref }}
echo ${{ github.ref }}
echo ${{ github.ref_name }}
- name: test 2
run: |
echo ${{ (github.event.pull_request.merged == true && github.ref_name == 'main') && 'production' || 'staging' }}
echo ${{ (github.event.pull_request.merged == true && github.ref_name == 'main') && '' || '--tag beta' }}
- name: test 3
run: |
echo ${{ env.MATT_ENV }}
echo ${{ env.PACKAGE_TAG }}
echo ${{ env.GITHUB_BRANCH }}
env:
MATT_ENV: ${{ (github.event.pull_request.merged == true && github.ref_name == 'main') && 'production' || 'staging' }}
PACKAGE_TAG: ${{ (github.event.pull_request.merged == true && github.ref_name == 'main') && '' || '--tag beta' }}