Update Manifest, build and commit the changes signing the commit payload.
This GitHub Action automates the process of checking out a repository, setting up Node.js, installing dependencies, updating the manifest.json
file, formatting it, and committing/pushing the changes with a signed commit.
-
manifestPath
:- Description: The path to the
manifest.json
file. - Required: No
- Default:
${{ github.workspace }}/manifest.json
- Description: The path to the
-
schemaPath
:- Description: The path to the plugin settings schema.
- Required: No
- Default:
${{ github.workspace }}/src/types/plugin-input.js
-
pluginEntry
:- Description: The path to the plugin entry file.
- Required: No
- Default:
${{ github.workspace }}/src/index.ts
-
commitMessage
:- Description: The commit message.
- Required: No
- Default:
chore: updated manifest.json and dist build
-
nodeVersion
:- Description: The version of Node.js to use.
- Default:
20.10.0
-
Check out the repository: Uses the
actions/checkout@v4
action to check out the repository. -
Set up Node.js: Uses the
actions/setup-node@v4
action to set up a specified version of Node.js. -
Install dependencies: Runs
yarn install
to install the project's dependencies with immutable and cache check settings. -
Compile TypeScript files: Compiles the TypeScript files using
yarn tsc
with the specified project configuration. -
Build project: Adds the
@vercel/ncc
package and builds the project usingncc
. -
Update manifest configuration JSON: Updates the
manifest.json
file with the plugin settings schema. -
Format manifest using Prettier: Installs Prettier and formats the
manifest.json
file and other project files. -
Commit and Push changes: Configures Git, adds the updated files to the commit, and pushes the changes to the repository.
name: Update Manifest and Commit Changes
on:
push:
jobs:
update-manifest:
runs-on: ubuntu-latest
steps:
- name: Update Manifest and Commit Changes
uses: ubiquity-os/action-deploy-plugin@main
with:
manifestPath: ${{ github.workspace }}/manifest.json
schemaPath: ${{ github.workspace }}/src/types/plugin-input.js
pluginEntry: ${{ github.workspace }}/src/index.ts
commitMessage: "chore: updated manifest.json and dist build"
nodeVersion: "20.10.0"
env:
APP_ID: ${{ secrets.APP_ID }}
APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }}
APP_INSTALLATION_ID: ${{ secrets.APP_INSTALLATION_ID }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN
: A GitHub token with repository permissions. This is automatically provided by GitHub Actions and does not require manual setup.
If GitHub App authentication is to be used, the following environment variables are needed:
APP_ID
: The GitHub App ID.APP_PRIVATE_KEY
: The GitHub App private key.APP_INSTALLATION_ID
: The installation ID for the GitHub App.
When APP_ID
and APP_PRIVATE_KEY
are provided, the action will use GitHub App authentication. If they are not provided, the action will default to using GITHUB_TOKEN
.
- Clones the repository and sets up Node.js.
- Installs project dependencies and compiles TypeScript files.
- Builds the project using
@vercel/ncc
. - Updates the
manifest.json
file. - Formats the project files using Prettier.
- Commits and pushes changes to the repository.