File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : automerge
2+
3+ on :
4+ workflow_run :
5+ workflows : [ tests ]
6+ types : [ completed ]
7+
8+ jobs :
9+ merge :
10+ if : |
11+ github.event.workflow_run.conclusion == 'success' &&
12+ github.event.workflow_run.event == 'pull_request' &&
13+ startsWith(github.event.workflow_run.head_branch, 'update-models-metadata')
14+ runs-on : ubuntu-latest
15+ permissions :
16+ contents : write
17+ pull-requests : write
18+ steps :
19+ - name : Merge PR
20+ env :
21+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
22+ REPO : ${{ github.repository }}
23+ BRANCH : ${{ github.event.workflow_run.head_branch }}
24+ run : |
25+ PR_NUMBER=$(gh pr list --repo "$REPO" --head "$BRANCH" --state open --json number --jq '.[0].number')
26+ if [ -n "$PR_NUMBER" ]; then
27+ gh pr merge "$PR_NUMBER" \
28+ --merge \
29+ --delete-branch \
30+ --subject "Update the models metadata (GH-${PR_NUMBER})" \
31+ --body "Co-authored-by: Artyom Vancyan <44609997+artyomvancyan@users.noreply.github.com>"
32+ fi
Original file line number Diff line number Diff line change 4444 title : Update the models metadata
4545 commit-message : Update the models metadata
4646 body : This PR updates the models metadata to keep the repository up-to-date with the upstream model costs.
47-
48- - name : Enable auto-merge
49- if : steps.create-pr.outputs.pull-request-number != ''
50- env :
51- GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
52- run : |
53- gh pr merge ${{ steps.create-pr.outputs.pull-request-number }} \
54- --auto \
55- --merge \
56- --subject "Update the models metadata (GH-${{ steps.create-pr.outputs.pull-request-number }})" \
57- --body "Co-authored-by: Artyom Vancyan <44609997+artyomvancyan@users.noreply.github.com>"
You can’t perform that action at this time.
0 commit comments