communique 1.4.0

Editorialized release notes powered by AI
name: CI

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

permissions: {}

jobs:
  trusted:
    if: ${{ github.actor == 'jdx' && (github.event_name != 'pull_request' || (github.event.pull_request.head.repo.full_name == github.repository && github.event.pull_request.user.login == 'jdx')) }}
    permissions:
      contents: read
    uses: $/.github/workflows/ci-impl.yml
    with:
      trusted: true

  untrusted:
    if: ${{ github.actor != 'jdx' || (github.event_name == 'pull_request' && (github.event.pull_request.head.repo.full_name != github.repository || github.event.pull_request.user.login != 'jdx')) }}
    permissions:
      contents: read
    uses: $/.github/workflows/ci-impl.yml
    with:
      trusted: false

  ci:
    name: ci
    if: ${{ always() && !cancelled() }}
    permissions: {}
    needs: [trusted, untrusted]
    runs-on: ubuntu-latest
    timeout-minutes: 1
    steps:
      - name: Check selected workflow result
        env:
          TRUSTED_RESULT: ${{ needs.trusted.result }}
          UNTRUSTED_RESULT: ${{ needs.untrusted.result }}
        run: |
          if [[ "$TRUSTED_RESULT" == success && "$UNTRUSTED_RESULT" == skipped ]] ||
             [[ "$TRUSTED_RESULT" == skipped && "$UNTRUSTED_RESULT" == success ]]; then
            exit 0
          fi
          echo "trusted=$TRUSTED_RESULT untrusted=$UNTRUSTED_RESULT"
          exit 1