Skip to content

Commit 836d59a

Browse files
committed
chore(ci): about permissions
1 parent f957c65 commit 836d59a

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

.github/workflows/deploy-chatbot.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on:
55
types:
66
- created
77

8+
permissions:
9+
contents: write
10+
actions: write
11+
812
jobs:
913
handle-slash-command:
1014
runs-on: ubuntu-latest
@@ -54,6 +58,7 @@ jobs:
5458
uses: actions/github-script@v7
5559
with:
5660
script: |
61+
console.log(`GH: ${{ secrets.GITHUB_TOKEN }}`);
5762
const environment = `${{ steps.parse_command.outputs.environment }}`;
5863
console.log(`ENVIRONMENT: ${environment}`);
5964
const project = `${{ steps.parse_command.outputs.project }}`;
@@ -101,7 +106,13 @@ jobs:
101106
const project = `${{ steps.parse_command.outputs.project }}`;
102107
const workflowId = `deploy-${environment}.yml`;
103108
104-
console.log(`🚀 Triggering workflow: ${workflowId} for project: ${project}`);
109+
const localRun = `${{ env.ACT }}` === "true";
110+
if (!localRun) {
111+
console.log(`🚀 Triggering workflow: ${workflowId} for project: ${project}`);
112+
} else {
113+
console.log(`Cancelling running a 🚀 workflow from our local env`);
114+
return;
115+
}
105116
106117
github.rest.actions.createWorkflowDispatch({
107118
owner: 'zerodaycode',

0 commit comments

Comments
 (0)