Skip to content

Main Back to Dev

Main Back to Dev #40

Workflow file for this run

name: Run on PRs
on:
pull_request:
types: [opened, closed]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9.15.0
run_install: false
- name: Install dependencies
run: pnpm i
- name: Run build for non-merged PR
if: github.event.action == 'closed' && github.event.pull_request.merged != true
id: build_non_merge
env:
ZE_SECRET_TOKEN: ${{ secrets.ZEPHYR_AUTH_TOKEN }}
run: |
OUTPUT=$(pnpm run build)
echo "$OUTPUT"
URL=$(echo "$OUTPUT" | grep -oE 'https://[^ ]+')
VERSION=$(echo "$OUTPUT" | grep -oP 'ZEPHYR\s+\K\S+(?=#)')
echo "Extracted Zephyr URL: $URL"
echo "Extracted VERSION: $VERSION"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "url=$URL" >> "$GITHUB_OUTPUT"
- name: Run build for merged PR on main or development
if: github.event.pull_request.merged == true &&
github.event.action == 'closed' &&
(github.event.pull_request.base.ref == 'main' || github.event.pull_request.base.ref == 'development')
id: build_merge
env:
ZE_SECRET_TOKEN: ${{ secrets.ZEPHYR_AUTH_TOKEN }}
run: pnpm run build