forked from FirebaseExtended/action-hosting-deploy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request FirebaseExtended#2 from FirebaseExtended/jh-modula…
…rize Convert to typescript & break index.js out into separate files
- Loading branch information
Showing
14 changed files
with
330 additions
and
266 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
node_modules | ||
package-lock.json | ||
.firebase/* | ||
**/*.d.ts |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { GitHub } from "@actions/github"; | ||
import { Context } from "@actions/github/lib/context"; | ||
|
||
// create a check and return a function that updates (completes) it | ||
export async function createCheck(github: GitHub, context: Context) { | ||
const check = await github.checks.create({ | ||
...context.repo, | ||
name: "Deploy Preview", | ||
head_sha: context.payload.pull_request?.head.sha, | ||
status: "in_progress", | ||
}); | ||
|
||
return async (details: Object) => { | ||
await github.checks.update({ | ||
...context.repo, | ||
check_run_id: check.data.id, | ||
completed_at: new Date().toISOString(), | ||
status: "completed", | ||
...details, | ||
}); | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { fileSync } from "tmp"; | ||
import { writeSync } from "fs"; | ||
|
||
// Set up Google Application Credentials for use by the Firebase CLI | ||
// https://cloud.google.com/docs/authentication/production#finding_credentials_automatically | ||
export async function createGacFile(googleApplicationCredentials: string) { | ||
const tmpFile = fileSync({ postfix: ".json" }); | ||
|
||
writeSync(tmpFile.fd, googleApplicationCredentials); | ||
|
||
return tmpFile.name; | ||
} |
Oops, something went wrong.