blob: 76335e7c5506727d4efb9b1248eb162282d8a3a3 [file] [log] [blame]
Jessica Wagantall6c5d5792023-08-30 11:58:31 -07001---
2name: Gerrit Merge
3
4# yamllint disable-line rule:truthy
5on:
6 workflow_dispatch:
7 inputs:
8 GERRIT_BRANCH:
9 description: "Branch that change is against"
10 required: true
11 type: string
12 GERRIT_CHANGE_ID:
13 description: "The ID for the change"
14 required: true
15 type: string
16 GERRIT_CHANGE_NUMBER:
17 description: "The Gerrit number"
18 required: true
19 type: string
20 GERRIT_CHANGE_URL:
21 description: "URL to the change"
22 required: true
23 type: string
24 GERRIT_EVENT_TYPE:
25 description: "Type of Gerrit event"
26 required: true
27 type: string
28 GERRIT_PATCHSET_NUMBER:
29 description: "The patch number for the change"
30 required: true
31 type: string
32 GERRIT_PATCHSET_REVISION:
33 description: "The revision sha"
34 required: true
35 type: string
36 GERRIT_PROJECT:
37 description: "Project in Gerrit"
38 required: true
39 type: string
40 GERRIT_REFSPEC:
41 description: "Gerrit refspec of change"
42 required: true
43 type: string
44
45jobs:
46 notify:
47 runs-on: ubuntu-latest
48 steps:
49 - name: Notify job start
50 # yamllint disable-line rule:line-length
51 uses: lfit/gerrit-review-action@6ac4c2322b68c0120a9b516eb0421491ee1b3fdf # v0.4
52 with:
53 host: ${{ vars.GERRIT_SERVER }}
54 username: ${{ vars.GERRIT_SSH_USER }}
55 key: ${{ secrets.GERRIT_SSH_PRIVKEY }}
56 known_hosts: ${{ vars.GERRIT_KNOWN_HOSTS }}
57 gerrit-change-number: ${{ inputs.GERRIT_CHANGE_NUMBER }}
58 gerrit-patchset-number: ${{ inputs.GERRIT_PATCHSET_NUMBER }}
59 vote-type: clear
60 comment-only: true
61 - name: Allow replication
62 run: sleep 10s
63
64 call-gerrit-rtdv3-merge:
65 needs: notify
66 # yamllint disable-line rule:line-length
67 uses: lfit/releng-reusable-workflows/.github/workflows/compose-rtdv3-merge.yaml@main
68 with:
69 GERRIT_BRANCH: ${{ inputs.GERRIT_BRANCH }}
70 GERRIT_CHANGE_ID: ${{ inputs.GERRIT_CHANGE_ID }}
71 GERRIT_CHANGE_NUMBER: ${{ inputs.GERRIT_CHANGE_NUMBER }}
72 GERRIT_CHANGE_URL: ${{ inputs.GERRIT_CHANGE_URL }}
73 GERRIT_EVENT_TYPE: ${{ inputs.GERRIT_EVENT_TYPE }}
74 GERRIT_PATCHSET_NUMBER: ${{ inputs.GERRIT_PATCHSET_NUMBER }}
75 GERRIT_PATCHSET_REVISION: ${{ inputs.GERRIT_PATCHSET_REVISION }}
76 GERRIT_PROJECT: ${{ inputs.GERRIT_PROJECT }}
77 GERRIT_REFSPEC: ${{ inputs.GERRIT_REFSPEC }}
78 secrets:
79 RTD_TOKEN: ${{ secrets.RTD_TOKEN }}
80
81 report-status:
82 if: ${{ always() }}
83 needs: [notify, call-gerrit-rtdv3-merge]
84 runs-on: ubuntu-latest
85 steps:
86 - name: Get workflow conclusion
87 uses: technote-space/workflow-conclusion-action@v3
88 - name: Report workflow conclusion
89 # yamllint disable-line rule:line-length
90 uses: lfit/gerrit-review-action@6ac4c2322b68c0120a9b516eb0421491ee1b3fdf # v0.4
91 with:
92 host: ${{ vars.GERRIT_SERVER }}
93 username: ${{ vars.GERRIT_SSH_USER }}
94 key: ${{ secrets.GERRIT_SSH_PRIVKEY }}
95 known_hosts: ${{ vars.GERRIT_KNOWN_HOSTS }}
96 gerrit-change-number: ${{ inputs.GERRIT_CHANGE_NUMBER }}
97 gerrit-patchset-number: ${{ inputs.GERRIT_PATCHSET_NUMBER }}
98 vote-type: ${{ env.WORKFLOW_CONCLUSION }}
99 comment-only: true