mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-12 17:04:57 +00:00
AAE-11221 - TRAVIS_EVENT_TYPE parse action
This commit is contained in:
parent
c3bc1b4eff
commit
bc57305e1e
28
.github/actions/travis-event-type-load/action.yml
vendored
Normal file
28
.github/actions/travis-event-type-load/action.yml
vendored
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
# TRAVIS_EVENT_TYPE= Indicates how the build was triggered. One of push, pull_request, api, cron
|
||||||
|
name: "travis-event-type-env-var"
|
||||||
|
description: "Mimic loading of a TRAVIS_EVENT_TYPE env var"
|
||||||
|
|
||||||
|
inputs:
|
||||||
|
event_name:
|
||||||
|
description: "override github.event_name"
|
||||||
|
required: false
|
||||||
|
default: ${{ github.event_name }}
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Parse env global
|
||||||
|
run: |
|
||||||
|
EVENT_TYPE=""
|
||||||
|
REGEX="(repository|workflow)_dispatch"
|
||||||
|
if [[ "${{ inputs.event_name }}" == "schedule" ]]; then
|
||||||
|
EVENT_TYPE="cron";
|
||||||
|
elif [[ "${{ inputs.event_name }}" == "pull_request" ]]; then
|
||||||
|
EVENT_TYPE="pull_request";
|
||||||
|
elif [[ "${{ inputs.event_name }}" == "push" ]]; then
|
||||||
|
EVENT_TYPE="push";
|
||||||
|
elif [[ "${{ inputs.event_name }}" =~ $REGEX ]]; then
|
||||||
|
EVENT_TYPE="api";
|
||||||
|
fi
|
||||||
|
echo "TRAVIS_EVENT_TYPE=${EVENT_TYPE}" >> $GITHUB_ENV
|
||||||
|
echo "exporting TRAVIS_EVENT_TYPE=${EVENT_TYPE}"
|
||||||
|
shell: bash
|
Loading…
x
Reference in New Issue
Block a user