|
10 | 10 | branches:
|
11 | 11 | - main
|
12 | 12 | - master
|
| 13 | + # TODO remove these need to be added to individual repositories |
| 14 | + - '\d+.\d+.\d+' |
| 15 | + - '\d+.\d+' |
| 16 | + - '\d+.x' |
| 17 | + tags: |
| 18 | + - 'v?\d+.\d+.\d+' |
| 19 | + - 'v?\d+.\d+' |
13 | 20 | workflow_call:
|
14 | 21 | inputs:
|
15 | 22 | strict:
|
@@ -44,6 +51,39 @@ permissions:
|
44 | 51 | pull-requests: read
|
45 | 52 |
|
46 | 53 | jobs:
|
| 54 | + match: |
| 55 | + if: github.event.repository.fork == false # Skip running the job on the fork itself (It still runs on PRs on the upstream from forks) |
| 56 | + concurrency: |
| 57 | + group: ${{ github.workflow }}-${{ github.event.pull_request.head.ref || github.ref }} |
| 58 | + cancel-in-progress: ${{ startsWith(github.event_name, 'pull_request') }} |
| 59 | + runs-on: ubuntu-latest |
| 60 | + outputs: |
| 61 | + content-source-match: ${{ steps.event-check.outputs.content-source-match != '' && steps.event-check.outputs.content-source-match || steps.match.outputs.content-source-match }} |
| 62 | + content-source-name: ${{ steps.event-check.outputs.content-source-name != '' && steps.event-check.outputs.content-source-name || steps.match.outputs.content-source-name }} |
| 63 | + steps: |
| 64 | + - name: Not a push event |
| 65 | + id: event-check |
| 66 | + if: contains(fromJSON('["merge_group", "pull_request", "pull_request_target"]'), github.event_name) |
| 67 | + # ensure we emit static output to simplify our checks in the build step |
| 68 | + run: | |
| 69 | + echo "content-source-match=true" >> $GITHUB_OUTPUT |
| 70 | + echo "content-source-name=next" >> $GITHUB_OUTPUT |
| 71 | + - name: Match for push events |
| 72 | + id: match |
| 73 | + if: contains(fromJSON('["push"]'), github.event_name) |
| 74 | + uses: elastic/docs-builder/actions/assembler-match@main |
| 75 | + with: |
| 76 | + ref_name: ${{ github.ref_name }} |
| 77 | + repository: ${{ github.repository }} |
| 78 | + - name: Debug |
| 79 | + if: contains(fromJSON('["merge_group", "pull_request", "pull_request_target"]'), github.event_name) |
| 80 | + run: | |
| 81 | + echo "Non sensitive data, echo'ing here temporarily to validate this job before connecting it further into the build job" |
| 82 | + echo "content-source-match=${{ steps.event-check.outputs.content-source-match != '' && steps.event-check.outputs.content-source-match || steps.match.outputs.content-source-match }}" |
| 83 | + echo "content-source-name=${{ steps.event-check.outputs.content-source-name != '' && steps.event-check.outputs.content-source-name || steps.match.outputs.content-source-name }}" |
| 84 | + echo "ref=${{ github.ref_name }}" |
| 85 | + echo "repo=${{ github.repository }}" |
| 86 | +
|
47 | 87 | build:
|
48 | 88 | if: github.event.repository.fork == false # Skip running the job on the fork itself (It still runs on PRs on the upstream from forks)
|
49 | 89 | concurrency:
|
|
52 | 92 | runs-on: ubuntu-latest
|
53 | 93 | env:
|
54 | 94 | GITHUB_PR_REF_NAME: ${{ github.event.pull_request.head.ref }}
|
| 95 | + needs: [ match ] |
55 | 96 | steps:
|
56 | 97 |
|
57 | 98 | - name: Checkout
|
|
0 commit comments