From a600a84110130425614e9e41b90fa28cc7a3e5cf Mon Sep 17 00:00:00 2001 From: Julio <1953782+julio-lopez@users.noreply.github.com> Date: Tue, 18 Jul 2023 15:38:17 -0700 Subject: [PATCH] chore(ci): improve triage workflow - Prevent funning the triage PR workflow for dependabot submitted PRs. This is failing because the required credential is not available for that workflow on dependabot submitted PRs. - Add names to jobs. --- .github/workflows/triage.yaml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/triage.yaml b/.github/workflows/triage.yaml index 16efc5a859..356ed92447 100644 --- a/.github/workflows/triage.yaml +++ b/.github/workflows/triage.yaml @@ -10,6 +10,7 @@ on: jobs: issues: if: github.repository == 'kanisterio/kanister' && github.event_name == 'issues' + name: Triage New Issue permissions: issues: write runs-on: ubuntu-latest @@ -33,13 +34,15 @@ jobs: repo-token: ${{ secrets.GH_TOKEN }} # must use a PAT here project: Kanister column: To Be Triaged - pull-requests: - if: github.repository == 'kanisterio/kanister' && github.event_name == 'pull_request' && !github.event.pull_request.head.repo.fork + pull-requests-comment: + name: Triage Pull Request + if: github.repository == 'kanisterio/kanister' && github.event_name == 'pull_request' && !github.event.pull_request.head.repo.fork && github.actor != 'dependabot' permissions: pull-requests: write runs-on: ubuntu-latest steps: - uses: actions-ecosystem/action-create-comment@v1.0.2 + # Avoid adding a comment when the PR is on the same repo. if: github.event.action == 'opened' with: github_token: ${{ secrets.GITHUB_TOKEN }} @@ -48,6 +51,9 @@ jobs: If you haven't already, please take a moment to review our project [contributing guideline](https://github.com/kanisterio/kanister/blob/master/CONTRIBUTING.md) and [Code of Conduct](https://github.com/kanisterio/kanister/blob/master/CODE_OF_CONDUCT.md) document. - uses: alex-page/github-project-automation-plus@v0.8.3 + # This only works for PRs opened in the same repo and not by dependabot. + # Other PRs don't get the necessary credentials. + if: github.repository == 'kanisterio/kanister' && !github.event.pull_request.head.repo.fork && github.actor != 'dependabot' with: repo-token: ${{ secrets.GH_TOKEN }} project: Kanister