Skip to content

Commit

Permalink
Rename GH token secret, skip notify job entirely if dependabot
Browse files Browse the repository at this point in the history
  • Loading branch information
dead-claudia committed Sep 24, 2024
1 parent e9bfac1 commit afd18f0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/notify-triage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ permissions:

jobs:
notify:
# Exclude dependabot's dependency updates. That's just going to annoy people.
if: ${{ github.actor != 'dependabot[bot]' }}
runs-on: ubuntu-latest
steps:
- name: Run workflow
# Exclude dependabot's dependency updates. That's just going to annoy people.
if: ${{ github.actor != 'dependabot[bot]' }}
env:
GH_TOKEN_SECRET: ${{ github.token }}
GH_TOKEN: ${{ github.token }}
run: |
set -euo pipefail
Expand All @@ -39,6 +39,5 @@ jobs:
echo "cmd: $cmd"
echo "id: $id"
export GITHUB_TOKEN="$GH_TOKEN_SECRET"
gh $cmd edit --repo "$GITHUB_REPOSITORY" "$id" --add-project 'Triage/bugs'
gh $cmd comment --repo "$GITHUB_REPOSITORY" "$id" --body '@MithrilJS/triage Please take a look.'
3 changes: 1 addition & 2 deletions .github/workflows/reject-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@ jobs:
echo "::error::This action must only be run on 'pull_request_target' events"
exit 1
esac
export GITHUB_TOKEN="$GH_TOKEN_SECRET"
gh pr close "$PR_URL" --comment "$MESSAGE" --reason 'not planned' &&
gh pr lock "$PR_URL" --reason 'resolved'
env:
GITHUB_TOKEN: ${{ github.token }}
GH_TOKEN: ${{ github.token }}
PR_URL: ${{ github.event.pull_request.url }}
MESSAGE: Hey @${{ github.actor }}, this pull request should be directed towards `${{ inputs.correct_branch }}`. Please file a new pull request targeting that branch instead.

0 comments on commit afd18f0

Please sign in to comment.