Skip to content

Commit

Permalink
[ci] Enabling workflow to be triggered manually
Browse files Browse the repository at this point in the history
[skip ci]
  • Loading branch information
diemol committed Sep 19, 2024
1 parent 95717cd commit 54d8355
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions .github/workflows/stage-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ name: Release Staging
on:
pull_request:
types: [ closed ]
workflow_dispatch:
inputs:
version:
description: 'Selenium version to release'
required: true

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -11,18 +16,26 @@ env:
jobs:
github-release:
if: >
github.event.pull_request.merged == true &&
(github.event.pull_request.merged == true &&
github.repository_owner == 'seleniumhq' &&
startsWith(github.event.pull_request.head.ref, 'release-preparation-')
startsWith(github.event.pull_request.head.ref, 'release-preparation-')) ||
(github.event_name == 'workflow_dispatch' &&
github.event.inputs.version != '' &&
github.repository_owner == 'seleniumhq')
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Extract version from branch name
id: extract_version
if: github.event.pull_request.merged == true
run: |
VERSION=$(echo $BRANCH_NAME | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Extract version from workflow input
if: github.event_name == 'workflow_dispatch'
run: |
VERSION=${{ inputs.version }}
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Prep git
run: |
git config --local user.email "selenium-ci@users.noreply.github.com"
Expand Down

0 comments on commit 54d8355

Please sign in to comment.