-
Notifications
You must be signed in to change notification settings - Fork 15
58 lines (51 loc) · 1.68 KB
/
automerge-release.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: Automatically merge release PR
on:
pull_request:
branches:
- master
types:
- opened
jobs:
merge-release-pr:
if: ${{ github.event.pull_request.head.ref == 'changeset-release/master' }}
name: Merge release PR
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
actions: write
issues: write
pull-requests: write
timeout-minutes: 1
steps:
- name: GSM Secrets
id: secrets_manager
uses: toptal/davinci-github-actions/[email protected]
with:
workload_identity_provider: ${{ secrets.IDENTITY_POOL }}
service_account: ${{ secrets.SA_IDENTITY_POOL }}
secrets_name: |-
TOPTAL_DEVBOT_TOKEN:toptal-ci/TOPTAL_DEVBOT_TOKEN
- name: Parse secrets
id: parse_secrets
uses: toptal/davinci-github-actions/[email protected]
with:
json: ${{ steps.secrets_manager.outputs.secrets }}
- name: Merge pull request
uses: actions/github-script@v7
with:
github-token: ${{ steps.parse_secrets.outputs.TOPTAL_DEVBOT_TOKEN }}
script: |
const commentBody = "This release pull request will be merged automatically"
await github.rest.issues.createComment({
owner: repository.owner,
issue_number: ${{ github.event.number }},
repo: repository.repo,
body: commentBody,
})
await github.rest.pulls.merge({
merge_method: "squash",
owner: repository.owner,
pull_number: ${{ github.event.number }},
repo: repository.repo,
})