github.com/adityamillind98/moby@v23.0.0-rc.4+incompatible/.github/workflows/.dco.yml (about) 1 # reusable workflow 2 name: .dco 3 4 # TODO: hide reusable workflow from the UI. Tracked in https://github.com/community/community/discussions/12025 5 6 on: 7 workflow_call: 8 9 env: 10 ALPINE_VERSION: 3.16 11 12 jobs: 13 run: 14 runs-on: ubuntu-20.04 15 steps: 16 - 17 name: Checkout 18 uses: actions/checkout@v3 19 with: 20 fetch-depth: 0 21 - 22 name: Dump context 23 uses: actions/github-script@v6 24 with: 25 script: | 26 console.log(JSON.stringify(context, null, 2)); 27 - 28 name: Get base ref 29 id: base-ref 30 uses: actions/github-script@v6 31 with: 32 result-encoding: string 33 script: | 34 if (/^refs\/pull\//.test(context.ref) && context.payload?.pull_request?.base?.ref != undefined) { 35 return context.payload.pull_request.base.ref; 36 } 37 return context.ref.replace(/^refs\/heads\//g, ''); 38 - 39 name: Validate 40 run: | 41 docker run --rm \ 42 -v "$(pwd):/workspace" \ 43 -e VALIDATE_REPO \ 44 -e VALIDATE_BRANCH \ 45 alpine:${{ env.ALPINE_VERSION }} sh -c 'apk add --no-cache -q bash git openssh-client && git config --system --add safe.directory /workspace && cd /workspace && hack/validate/dco' 46 env: 47 VALIDATE_REPO: ${{ github.server_url }}/${{ github.repository }}.git 48 VALIDATE_BRANCH: ${{ steps.base-ref.outputs.result }}