Skip to content

Commit

Permalink
ci: add personal access tokens for github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnsonMao committed Jan 11, 2025
1 parent bc78786 commit 21a393b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/ci-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ jobs:
steps:
- name: Git checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.BOT_PAT }}

- name: Cache dependencies
id: cache
Expand Down Expand Up @@ -127,6 +129,8 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.BOT_PAT }}

- name: Send Lint Failed Notification
if: ${{ needs.lint.result == 'failure' }}
Expand All @@ -135,7 +139,7 @@ jobs:
TYPE: failure
TITLE: "❌ Lint Failed"
DESCRIPTION: "PR Link: [PR #${{ github.event.number }}](${{ env.PR_URL }})"
DISCORD_WEBHOOK_URL: ${{ secrets.SANDBOX_DISCORD_WEBHOOK_URL }}
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}

- name: Send Build and Deploy Failed Notification
if: ${{ needs.build_and_deploy.result == 'failure' }}
Expand All @@ -144,7 +148,7 @@ jobs:
TYPE: failure
TITLE: "❌ Build and Deploy Failed"
DESCRIPTION: "PR Link: [PR #${{ github.event.number }}](${{ env.PR_URL }})"
DISCORD_WEBHOOK_URL: ${{ secrets.SANDBOX_DISCORD_WEBHOOK_URL }}
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}

- name: Send Build Succeeded Notification
if: ${{ needs.build_and_deploy.result == 'success' }}
Expand All @@ -153,4 +157,4 @@ jobs:
TYPE: success
TITLE: "✅ Build Succeeded"
DESCRIPTION: "Preview URL: ${{ needs.build_and_deploy.outputs.preview-url }}\\nEnvironment: ${{ needs.build_and_deploy.outputs.deploy-env }}"
DISCORD_WEBHOOK_URL: ${{ secrets.SANDBOX_DISCORD_WEBHOOK_URL }}
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
4 changes: 3 additions & 1 deletion .github/workflows/pr-notification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.BOT_PAT }}

- name: Send PR Notification
uses: ./.github/actions/notification
Expand All @@ -26,4 +28,4 @@ jobs:
AUTHOR_NAME: ${{ github.event.pull_request.user.name || github.event.pull_request.user.login }}
AUTHOR_URL: ${{ github.event.pull_request.user.html_url }}
AUTHOR_ICON_URL: ${{ github.event.pull_request.user.avatar_url }}
DISCORD_WEBHOOK_URL: ${{ secrets.SANDBOX_DISCORD_WEBHOOK_URL }}
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}

0 comments on commit 21a393b

Please sign in to comment.