Skip to content

Commit

Permalink
github-actions: use ephemeral github tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
v1v committed Oct 23, 2024
1 parent c142a4f commit 617c0e0
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ on:
permissions:
contents: write
issues: write
pull-requests: write

env:
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
Expand Down Expand Up @@ -173,10 +172,28 @@ jobs:
with:
fetch-depth: 0

- name: Get token
id: get_token
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0
with:
app_id: ${{ secrets.OBS_AUTOMATION_APP_ID }}
private_key: ${{ secrets.OBS_AUTOMATION_APP_PEM }}
permissions: >-
{
"contents": "write",
"pull_requests": "write"
}
repositories: >-
["apm-agent-dotnet"]
- name: Setup git config
uses: elastic/oblt-actions/git/setup@v1
with:
github-token: ${{ steps.get_token.outputs.token }}

- name: Create GitHub Pull Request if minor release.
env:
GH_TOKEN: ${{ steps.get_token.outputs.token }}
run: |
echo "as long as there is a major.x branch"
existed_in_local=$(git ls-remote --heads origin ${TARGET_BRANCH})
Expand Down

0 comments on commit 617c0e0

Please sign in to comment.