Skip to content

Commit

Permalink
add COMPONENT_PATH input (#6)
Browse files Browse the repository at this point in the history
* add COMPONENT_PATH input

* add working-directory to install/build examples

* remove unnecessary summary output line

* conditionally show COMPONENT_PATH input in summary
  • Loading branch information
BrandonALittle authored Jun 19, 2024
1 parent c8aef69 commit a16fab8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ This GitHub Action publishes a component via Prismatic's Prism CLI.

## Inputs

- **COMPONENT_PATH** (optional): The path to the component's index.ts/js file. If not provided, the root will be used.
- **CUSTOMER_ID** (optional): The ID of the customer with which to associate the component.
- **PRISMATIC_URL** (required): The target Prismatic API to publish to.
- **PRISM_REFRESH_TOKEN** (required): The token granting access to the API at the PRISMATIC_URL provided.
- **CUSTOMER_ID** (optional): The ID of the customer with which to associate the component.
- **COMMENT** (optional): Any comments to associate with the component.
- **SKIP_COMMIT_HASH_PUBLISH** (optional): Skip inclusion of commit hash in metadata. Default is `false`.
- **SKIP_COMMIT_URL_PUBLISH** (optional): Skip inclusion of commit URL in metadata. Default is `false`.
Expand All @@ -21,6 +22,7 @@ To use this action in your workflow, add the following step configuration to you
- name: <STEP NAME>
uses: prismatic-io/component-publisher@v1.0
with:
COMPONENT_PATH: src/my-component
PRISMATIC_URL: ${{ vars.PRISMATIC_URL }}
PRISM_REFRESH_TOKEN: ${{ secrets.PRISM_REFRESH_TOKEN }}
```
Expand All @@ -34,9 +36,11 @@ The following steps are an example of preparing the component bundle prior to pu
- name: Install dependencies
run: npm install
working-directory: src/my-component
- name: Build component bundle
run: npm run build
working-directory: src/my-component
```

## Acquiring PRISM_REFRESH_TOKEN
Expand Down
12 changes: 12 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ branding:
color: "blue"

inputs:
COMPONENT_PATH:
description: "The path to the component's index.ts/js. If not provided, the root directory will be used."
required: false
CUSTOMER_ID:
description: "The ID of the customer with which to associate the component."
required: false
Expand Down Expand Up @@ -150,6 +153,10 @@ runs:
run: |
source $GITHUB_WORKSPACE/logger.sh
if [ -n "${{ inputs.COMPONENT_PATH }}" ]; then
cd ${{ inputs.COMPONENT_PATH }}
fi
COMMAND="prism components:publish \
--skip-on-signature-match \
--no-confirm"
Expand Down Expand Up @@ -203,6 +210,11 @@ runs:
echo "### Component Published :rocket:"
echo "|![Prismatic Logo](https://app.prismatic.io/logo_fullcolor_white.svg)| Publish Info |"
echo "| --------------------- | --------------- |"
if [ -n "${{ inputs.COMPONENT_PATH }}" ]; then
echo "| Source Directory | ${{ inputs.COMPONENT_PATH }} |"
fi
echo "| Target Stack | ${{ inputs.PRISMATIC_URL }} |"
echo "| Commit Link | ${{ steps.commit-details.outputs.COMMIT_URL }} |"
Expand Down

0 comments on commit a16fab8

Please sign in to comment.