From 97ddf02c1a88d75971a51ca5d2632983466bf040 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Tue, 8 Oct 2024 16:36:55 +0200 Subject: [PATCH] github-actions: use ephemeral tokens (#2136) --- .github/workflows/labeler.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 61db99ad0..26e551bc3 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -15,6 +15,16 @@ jobs: triage: 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: >- + { + "members": "read" + } - name: Add agent-python label uses: actions-ecosystem/action-add-labels@v1 with: @@ -24,7 +34,7 @@ jobs: with: github-org: "elastic" github-user: ${{ github.actor }} - github-token: ${{ secrets.APM_TECH_USER_TOKEN }} + github-token: ${{ steps.get_token.outputs.token }} - name: Add community and triage labels if: contains(steps.is_elastic_member.outputs.result, 'false') && github.actor != 'dependabot[bot]' && github.actor != 'apmmachine' uses: actions-ecosystem/action-add-labels@v1