Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

github-actions: use ephemeral tokens #892

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions .github/workflows/apm-agent-meta-issue-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@ jobs:
meta-issue-handler:
runs-on: ubuntu-latest
steps:
- 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: >-
{
"issues": "write",
"members": "read"
}
- name: Check team membership for user
uses: elastic/[email protected]
id: checkUserMember
Expand All @@ -18,13 +29,13 @@ jobs:
team: 'apm'
usernamesToExclude: |
apmmachine
GITHUB_TOKEN: ${{ secrets.APM_TECH_USER_TOKEN }}
GITHUB_TOKEN: ${{ steps.get_token.outputs.token }}
- name: Create sub issues
if: steps.checkUserMember.outputs.isTeamMember == 'true' && contains(github.event.issue.labels.*.name, 'meta') && contains(github.event.issue.labels.*.name, 'apm-agents')
uses: elastic/[email protected]
id: create_sub_issues
with:
token: "${{ secrets.APM_TECH_USER_TOKEN }}"
token: ${{ steps.get_token.outputs.token }}
metaIssue: "${{ toJSON(github.event.issue) }}"
bodyRegex: "(.*)(<!---repos-start--->.*<!---repos-end--->)(.*)"
labelsToExclude: "meta,apm-agents"
Expand Down
Loading