Skip to content

Commit

Permalink
chore(ci): improve triage workflow
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
julio-lopez committed Sep 15, 2023
1 parent 47ff44f commit a600a84
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/triage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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/[email protected]
# Avoid adding a comment when the PR is on the same repo.
if: github.event.action == 'opened'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -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/[email protected]
# 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
Expand Down

0 comments on commit a600a84

Please sign in to comment.