|
7 | 7 | trigger: |
8 | 8 | runs-on: ubuntu-latest |
9 | 9 | steps: |
| 10 | + - name: Extract semver tag |
| 11 | + id: semver |
| 12 | + run: | |
| 13 | + REF_NAME="${{ github.ref_name }}" |
| 14 | + # Check if ref matches semver pattern (e.g., v1.2.3 or 1.2.3) |
| 15 | + if [[ "$REF_NAME" =~ ^v?[0-9]+\.[0-9]+\.[0-9]+.*$ ]]; then |
| 16 | + echo "semver=$REF_NAME" >> $GITHUB_OUTPUT |
| 17 | + echo "is_semver=true" >> $GITHUB_OUTPUT |
| 18 | + else |
| 19 | + echo "semver=" >> $GITHUB_OUTPUT |
| 20 | + echo "is_semver=false" >> $GITHUB_OUTPUT |
| 21 | + fi |
| 22 | + |
10 | 23 | - name: Trigger private repo workflow |
11 | 24 | run: | |
12 | 25 | curl -L \ |
13 | 26 | -X POST \ |
14 | 27 | -H "Accept: application/vnd.github+json" \ |
15 | 28 | -H "Authorization: Bearer ${{ secrets.PRIVATE_REPO_PAT }}" \ |
16 | 29 | -H "X-GitHub-Api-Version: 2022-11-28" \ |
17 | | - https://api.github.com/repos/locusrobotics/locus_orbbec_ros2/dispatches \ |
18 | | - -d '{"event_type":"trigger-from-public","client_payload":{"param1":"value1","param2":"value2"}}' |
| 30 | + https://api.github.com/repos/YOUR_ORG/PRIVATE_REPO/dispatches \ |
| 31 | + -d '{ |
| 32 | + "event_type":"trigger-from-public", |
| 33 | + "client_payload":{ |
| 34 | + "origin_repo":"${{ github.repository }}", |
| 35 | + "origin_repo_url":"${{ github.repositoryUrl }}", |
| 36 | + "ref":"${{ github.ref }}", |
| 37 | + "ref_name":"${{ github.ref_name }}", |
| 38 | + "ref_type":"${{ github.ref_type }}", |
| 39 | + "semver":"${{ steps.semver.outputs.semver }}", |
| 40 | + "is_semver":"${{ steps.semver.outputs.is_semver }}", |
| 41 | + "sha":"${{ github.sha }}", |
| 42 | + "event_name":"${{ github.event_name }}", |
| 43 | + "actor":"${{ github.actor }}", |
| 44 | + "pr_number":"${{ github.event.pull_request.number }}" |
| 45 | + } |
| 46 | + }' |
0 commit comments