Skip to content

Commit 38d119b

Browse files
aalejbkendall
andauthored
Added permissions for GitHub workflow config (#6791)
* Added permissions for GitHub workflow config * Added a changelog entry --------- Co-authored-by: Bryan Kendall <[email protected]>
1 parent 9dc6d38 commit 38d119b

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
that this is a preview feature and if you find any bugs, please file them
55
here: <https://github.com/firebase/firebase-tools/issues>.
66
- Improve FAH onboarding flow to connect backends with SCMs (#6764).
7+
- Fixed issue where GitHub actions would fail due to lack of permission. (#6791)

src/init/features/hosting/github.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ function mkdirNotExists(dir: string): void {
277277
type GitHubWorkflowConfig = {
278278
name: string;
279279
on: string | { [key: string]: { [key: string]: string[] } };
280+
permissions?: string | { [key: string]: string };
280281
jobs: {
281282
[key: string]: {
282283
if?: string;
@@ -300,6 +301,11 @@ function writeChannelActionYMLFile(
300301
const workflowConfig: GitHubWorkflowConfig = {
301302
name: "Deploy to Firebase Hosting on PR",
302303
on: "pull_request",
304+
permissions: {
305+
checks: "write",
306+
contents: "read",
307+
"pull-requests": "write",
308+
},
303309
jobs: {
304310
["build_and_preview"]: {
305311
if: "${{ github.event.pull_request.head.repo.full_name == github.repository }}", // secrets aren't accessible on PRs from forks

0 commit comments

Comments
 (0)