Skip to content

Commit 839d06d

Browse files
traskArielDemarco
andauthored
Use otelbot instead for release automation (#923)
Co-authored-by: ArielDemarco <[email protected]>
1 parent 4b8e7e1 commit 839d06d

File tree

2 files changed

+25
-6
lines changed

2 files changed

+25
-6
lines changed

.github/workflows/Create-Release-PR.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ jobs:
1111
Release:
1212
runs-on: ubuntu-latest
1313
permissions:
14-
contents: write
15-
pull-requests: write
14+
contents: write
1615
steps:
1716
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
1817
with:
@@ -26,10 +25,19 @@ jobs:
2625
sed -i -e 's/spec.version = ".*"/spec.version = "${{ inputs.new_version }}"/' OpenTelemetry-Swift-Protocol-Exporter-Http.podspec
2726
sed -i -e 's/spec.version = ".*"/spec.version = "${{ inputs.new_version }}"/' OpenTelemetry-Swift-SdkResourceExtension.podspec
2827
sed -i -e 's/spec.version = ".*"/spec.version = "${{ inputs.new_version }}"/' OpenTelemetry-Swift-PersistenceExporter.podspec
28+
29+
- uses: actions/create-github-app-token@a8d616148505b5069dccd32f177bb87d7f39123b # v2.1.1
30+
id: otelbot-token
31+
with:
32+
app-id: ${{ vars.OTELBOT_APP_ID }}
33+
private-key: ${{ secrets.OTELBOT_PRIVATE_KEY }}
34+
2935
- name: Create Pull Request
3036
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
3137
with:
32-
token: ${{ secrets.RELEASE_TOKEN }}
38+
# not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows
39+
token: ${{ steps.otelbot-token.outputs.token }}
40+
branch-token: ${{ secrets.GITHUB_TOKEN }}
3341
branch: release/${{inputs.new_version}}
3442
commit-message: 'Release ${{inputs.new_version}}'
3543
title: 'Release ${{inputs.new_version}}'
@@ -38,5 +46,3 @@ jobs:
3846
This PR is auto-generated by
3947
[create-pull-request](https://github.com/peter-evans/create-pull-request).
4048
base: main
41-
42-

.github/workflows/update-core-dependencies.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,14 @@ on:
1313
default: true
1414
type: boolean
1515

16+
permissions:
17+
contents: read
18+
1619
jobs:
1720
update-dependencies:
1821
runs-on: ubuntu-latest
22+
permissions:
23+
contents: write
1924
steps:
2025
- name: Checkout code
2126
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
@@ -40,11 +45,19 @@ jobs:
4045
echo "has_changes=false" >> $GITHUB_OUTPUT
4146
fi
4247
48+
- uses: actions/create-github-app-token@a8d616148505b5069dccd32f177bb87d7f39123b # v2.1.1
49+
id: otelbot-token
50+
with:
51+
app-id: ${{ vars.OTELBOT_APP_ID }}
52+
private-key: ${{ secrets.OTELBOT_PRIVATE_KEY }}
53+
4354
- name: Create Pull Request
4455
if: steps.changes.outputs.has_changes == 'true' && github.event.inputs.create_pr == 'true'
4556
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
4657
with:
47-
token: ${{ secrets.RELEASE_TOKEN }}
58+
# not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows
59+
token: ${{ steps.otelbot-token.outputs.token }}
60+
branch-token: ${{ secrets.GITHUB_TOKEN }}
4861
commit-message: |
4962
Update opentelemetry-swift-core dependencies to ${{ github.event.inputs.core_version }}
5063

0 commit comments

Comments
 (0)