-
Notifications
You must be signed in to change notification settings - Fork 1.1k
66 lines (64 loc) · 2.19 KB
/
bump_versions.yml
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
59
60
61
62
63
64
65
66
on:
schedule:
# At 08:00 on every day-of-week from Monday through Friday.
- cron: '0 8 * * 1-5'
permissions: {}
jobs:
sdk-versions:
permissions:
contents: write # for git push
pull-requests: write # to create pull request
runs-on: ubuntu-latest
steps:
- id: set-versions
name: Load latest SDK versions
uses: actions/github-script@v7
with:
github-token: ${{secrets.GITHUB_TOKEN}}
result-encoding: string
script: |
const clients = [
'datadog-api-client-go',
'datadog-api-client-java',
'datadog-api-client-python',
'datadog-api-client-ruby',
'datadog-api-client-typescript',
'datadog-api-client-rust',
'integrations-core'
]
const versions = await Promise.all(clients.map(async (repo) => {
const releases = await github.rest.repos.listReleases({
owner: 'DataDog',
repo: repo
})
return {client: repo, version: releases.data[0]["tag_name"]}
}))
console.log(versions)
return JSON.stringify(versions)
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Write version
run: |-
echo '${{steps.set-versions.outputs.result}}' | jq > ./data/sdk_versions.json
git add ./data/sdk_versions.json
git config user.name packages
git config user.email [email protected]
git add .
git commit -m "Bump SDK"
git push -f origin HEAD:refs/heads/sdk/versions
- uses: actions/github-script@v7
name: Propose change with latest versions
with:
github-token: ${{secrets.GITHUB_TOKEN}}
result-encoding: string
script: |
await github.rest.pulls.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: "[SDK] new versions are available",
body: "SSID",
head: "sdk/versions",
base: "master",
maintainer_can_modify: true
})