Skip to content

Commit

Permalink
feat: add comment input (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
teunverhaert authored Jul 19, 2024
1 parent a5de17c commit 6733526
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ jobs:
- `app-definition-id` (_required_): The id of the app definition.
- `access-token` (_required_): A personal access token for the Content Management API. Should be stored as a secret in your GitHub repository (`Settings` -> `Secrets` -> `Actions`).
- `folder` (_required_): The folder which is deployed to Contentful App Hosting. Usually, this is the `build` folder.
- `comment` : A comment which will be associated with the created `AppBundle`. Can be used to differentiate bundles.
- `allow-tracking` (_optional_): Flag that allows us to track the usage of the GitHub Action. Accepted values can be either `true` or `false`, default value will be `true`.

## Running
Expand Down
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ inputs:
folder:
description: 'The folder which is deployed to Contentful App Hosting'
required: true
comment:
description: 'A comment which will be associated with the created AppBundle. Can be used to differentiate bundles.'
required: false
allow-tracking:
description: 'The flag to allow tracking of the app-definition-id, branch deployed'
required: false
Expand Down
2 changes: 2 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ async function deploy() {
const appDefinitionId = core.getInput("app-definition-id");
const accessToken = core.getInput("access-token");
const folder = core.getInput("folder");
const comment = core.getInput("comment");
const allowTracking = core.getInput("allow-tracking");
const branchDeployed = github.context.ref;
(0, analytics_1.track)({ branch_name: branchDeployed, app_key: appDefinitionId }, allowTracking);
Expand All @@ -90,6 +91,7 @@ async function deploy() {
organizationId,
definitionId: appDefinitionId,
token: accessToken,
comment: comment,
userAgentApplication: "contentful.actions-app-deploy",
});
}
Expand Down
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ async function deploy(): Promise<void> {
const appDefinitionId: string = core.getInput("app-definition-id");
const accessToken: string = core.getInput("access-token");
const folder: string = core.getInput("folder");
const comment: string | undefined = core.getInput("comment");
const allowTracking: string = core.getInput("allow-tracking");

const branchDeployed = github.context.ref;
Expand All @@ -23,6 +24,7 @@ async function deploy(): Promise<void> {
organizationId,
definitionId: appDefinitionId,
token: accessToken,
comment: comment,
userAgentApplication: "contentful.actions-app-deploy",
});
} catch (error) {
Expand Down

0 comments on commit 6733526

Please sign in to comment.