* build(deps): bump actions/setup-python from 3 to 4 Bumps [actions/setup-python](https://github.com/actions/setup-python) from 3 to 4. - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/setup-python dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * fix(github workflow): remove unnecessary action --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Iain Sproat <68657+iainsproat@users.noreply.github.com>
Speckle Automate GitHub Action
Introduction
This repository contains the source code for the Speckle Automate GitHub Action. It is a GitHub Action that builds a Speckle Automate Function from your source code.
Documentation
Inputs
speckle_server_url
The URL of the Speckle Automate Server to publish the function to.
Defaults to https://automate.speckle.xyz.
speckle_token
The Speckle Automate API token to use to publish the function. This token must have functions:write permissions.
This must be stored in GitHub as an encrypted secret. This token must be protected, as it allows anyone with access to it to publish functions as you to your Speckle Automate Server.
If you believe your token has been compromised, please revoke it immediately on your Speckle Automate Server. Please also audit your Speckle Automate Function changes to ensure that they were not made by an unauthorized party.
Please note that this is not a Speckle Account token, but a Speckle Automate API token. You can create one by logging into the Speckle Automate Server and going to the API Tokens page.
Outputs
function_id
The unique ID of the published function.
version_id
The unique ID of this version of the published function.
Example usage
Publish a function to automate.speckle.xyz
uses: actions/speckle-automate-github-action@0.1.0
with:
# speckle_server_url is optional and defaults to https://automate.speckle.xyz
# speckle_server_url: https://automate.speckle.xyz
# https://docs.github.com/en/actions/security-guides/encrypted-secrets#using-encrypted-secrets-in-a-workflow
speckle_token: ${{ secrets.speckle_token }}
Publish a function to a self-hosted server
uses: actions/speckle-automate-github-action@0.1.0
with:
# please update to the url of your self-hosted server
speckle_server_url: https://example.org
# https://docs.github.com/en/actions/security-guides/encrypted-secrets#using-encrypted-secrets-in-a-workflow
speckle_token: ${{ secrets.speckle_token }}
Developing & Debugging
Running locally
Prerequisites to running locally
Building
- Clone this repository
- Run
yarn installto install dependencies - Run
yarn build
Running built image
-
Set the Speckle Server URL and Speckle Token environment variables, and run the image:
export SPECKLE_SERVER_URL="https://automate.speckle.xyz" # (or your self-hosted server, which may be `localhost:3000` if running a development server) export SPECKLE_TOKEN="ABCD1234" #(replace with your token) docker run --rm \ -e SPECKLE_SERVER_URL="${SPECKLE_SERVER_URL}" \ -e SPECKLE_TOKEN="${SPECKLE_TOKEN}" \ -e SPECKLE_FUNCTION_PATH="./examples/basic" \ -e GITHUB_WORKSPACE="/home/runner/work/specklesystems/speckle-automate-github-action" \ -e GITHUB_OUTPUT="/output/github_output" \ -v "$(pwd):/home/runner/work/specklesystems/speckle-automate-github-action" \ -v "/tmp:/output" \ speckle/speckle-automate-github-action:local -
Inspect the output at
/tmp/github_output:cat /tmp/github_output
Developing
Prerequisites to developing
- Docker
- Node.js (v18)
- Yarn
- Pre-Commit
- Clone this repository
- Run
pre-commit installto install the pre-commit hooks - Run
yarn installto install dependencies
Testing
-
Run unit tests:
yarn test -
Run integration tests:
yarn test:e2e
Linting
- Run
yarn pre-committo run all pre-commit hooks. - Address all linting errors prior to committing changes.
Contributing
Please make sure you read the contribution guidelines and code of conduct for an overview of the practices we try to follow.
Community
The Speckle Community hangs out on the forum, do join and introduce yourself & feel free to ask us questions!
Security
For any security vulnerabilities or concerns, please contact us directly at security[at]speckle.systems.
License
Unless otherwise described, the code in this repository is licensed under the Apache-2.0 License. Please note that some modules, extensions or code herein might be otherwise licensed. This is indicated either in the root of the containing folder under a different license file, or in the respective file's header. If you have any questions, don't hesitate to get in touch with us via email.