From 0672a1fd452b9ba5b53d74de8eea731a5db48083 Mon Sep 17 00:00:00 2001 From: neuronull Date: Fri, 5 Jan 2024 08:35:36 -0700 Subject: [PATCH 1/2] chore(ci): fix changelog workflow extern contribs --- .github/workflows/changelog.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/changelog.yaml b/.github/workflows/changelog.yaml index 9def6acffca50..a20bebb53eb2c 100644 --- a/.github/workflows/changelog.yaml +++ b/.github/workflows/changelog.yaml @@ -21,6 +21,7 @@ jobs: - uses: actions/checkout@v3 - name: Generate authentication token + if: ${{ secrets.GH_APP_DATADOG_VECTOR_CI_APP_ID != '' }} id: generate_token uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a with: @@ -28,6 +29,7 @@ jobs: private_key: ${{ secrets.GH_APP_DATADOG_VECTOR_CI_APP_PRIVATE_KEY }} - name: Get PR comment author + if: ${{ secrets.GH_APP_DATADOG_VECTOR_CI_APP_ID != '' }} id: author uses: tspascoal/get-user-teams-membership@v3 with: @@ -36,6 +38,7 @@ jobs: GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }} - env: + # if the prior step did not run, this var will be '' AUTHOR_IS_TEAM_MEMBER: ${{ steps.author.outputs.isTeamMember }} run: | if [[ $PR_HAS_LABEL == 'true' ]] ; then From 07c009f5a899204db6a88a3e80a8aa138ea8866f Mon Sep 17 00:00:00 2001 From: neuronull Date: Fri, 5 Jan 2024 08:47:16 -0700 Subject: [PATCH 2/2] use fork check --- .github/workflows/changelog.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/changelog.yaml b/.github/workflows/changelog.yaml index a20bebb53eb2c..4d739f4244068 100644 --- a/.github/workflows/changelog.yaml +++ b/.github/workflows/changelog.yaml @@ -21,7 +21,8 @@ jobs: - uses: actions/checkout@v3 - name: Generate authentication token - if: ${{ secrets.GH_APP_DATADOG_VECTOR_CI_APP_ID != '' }} + # don't run this step if the PR is from a fork since the secrets won't exist + if: ${{ github.event.pull_request.head.repo.full_name == github.repository }} id: generate_token uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a with: @@ -29,7 +30,8 @@ jobs: private_key: ${{ secrets.GH_APP_DATADOG_VECTOR_CI_APP_PRIVATE_KEY }} - name: Get PR comment author - if: ${{ secrets.GH_APP_DATADOG_VECTOR_CI_APP_ID != '' }} + # don't run this step if the PR is from a fork since the secrets won't exist + if: ${{ github.event.pull_request.head.repo.full_name == github.repository }} id: author uses: tspascoal/get-user-teams-membership@v3 with: