Skip to content

fix: make sure correct PIPE redirect strategy #7

fix: make sure correct PIPE redirect strategy

fix: make sure correct PIPE redirect strategy #7

# This is a basic workflow to help you get started with Actions
name: Docs Request Trigger
# Controls when the workflow will run
on:
pull_request:
branches: [ "master" ]
paths:
- '.github/workflows/docs-request-trigger.yml'
- 'docs/**'
types: [closed]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
if: github.event.pull_request.merged == true
# The type of runner that the job will run on
runs-on: ubuntu-latest
# work on CI script dir
defaults:
run:
working-directory: .github/scripts
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
# Runs trigger CI
- name: Make the script files executable
run: chmod +x trigger-docs.sh
- name: trigger a CI
run: |
COMMIT_ID=$([ "${{ github.event_name }}" == "pull_request" ] && echo "${{ github.event.pull_request.head.sha }}" || echo "${{ github.sha }}")
echo "Using Commit ID: $COMMIT_ID"
echo "$GITHUB_REF"
PR_ID=$(echo "$GITHUB_REF" | sed 's@refs/pull/\([0-9]\+\)/.*@\1@')
echo "PR ID is $PR_ID"
./trigger-docs.sh "$COMMIT_ID" "${{ secrets.CI_SECRET }}" "${{ github.event.pull_request.head.repo.clone_url }}" "$PR_ID" "${{ secrets.CHECK_USER_NAME }}" "${{ secrets.CHECK_TOKEN }}"