7
7
branches : ["main"]
8
8
workflow_dispatch : {}
9
9
10
+ permissions :
11
+ pull-requests : write
12
+
10
13
jobs :
11
14
unit :
12
15
runs-on : ubuntu-latest
@@ -16,11 +19,37 @@ jobs:
16
19
with :
17
20
go-version : ' 1.22'
18
21
- run : make test
19
- # integration:
20
- # runs-on: ubuntu-latest
21
- # steps:
22
- # - uses: actions/checkout@v4
23
- # - uses: actions/setup-go@v5
24
- # with:
25
- # go-version: '1.22'
26
- # - run: make integration
22
+ diego-compat :
23
+ runs-on : ubuntu-latest
24
+ if : github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'
25
+ steps :
26
+ - uses : actions/checkout@v4
27
+ with :
28
+ repository : sap-contributions/diego-release
29
+ ref : add-cnb-app-lifecycle
30
+ submodules : recursive
31
+ - uses : actions/setup-go@v5
32
+ with :
33
+ go-version : ' 1.22'
34
+ - run : |
35
+ cd src/code.cloudfoundry.org && go get -u code.cloudfoundry.org/cnbapplifecycle@${{ github.event.pull_request.head.sha }}
36
+ automerge :
37
+ runs-on : ubuntu-latest
38
+ if : github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'
39
+ needs : [diego-compat, unit]
40
+ steps :
41
+ - name : Dependabot metadata
42
+ id : dependabot-metadata
43
+ uses : dependabot/fetch-metadata@v1
44
+ - name : Approve a PR if not already approved
45
+ run : |
46
+ gh pr checkout "$PR_URL" # sets the upstream metadata for `gh pr status`
47
+ if [ "$(gh pr status --json reviewDecision -q .currentBranch.reviewDecision)" != "APPROVED" ];
48
+ then gh pr review --approve "$PR_URL"
49
+ else echo "PR already approved, skipping additional approvals to minimize emails/notification noise.";
50
+ fi
51
+
52
+ # gh pr merge --merge --rebase "$PR_URL"
53
+ env :
54
+ PR_URL : ${{ github.event.pull_request.html_url }}
55
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments