Using GitHub Actions to create a development version of Skylark, the CMS or more? This is the GitHub Action for you.
This Action adds a comment to a pull request containing Skylark-related environment URLs and the status of the workflow that is creating the related environments.
Its aim is to improve the feedback loop by allowing URLs to be found on the PR as opposed to looking through GitHub workflows.
- uses: skylark-platform/comment-url-on-pr@v1.0.0
with:
title: 'A title for the comment'
status: building
github_token: ${{ github.token }}
classic_cms_url: https://classic-cms-url.com
skylark_url: https://skylark-url.com
launcher_url: https://launcher-url.com
object_registry_url: https://object-registry-url.com
comment_id: 'my custom id'
- uses: skylark-platform/comment-url-on-pr@v1.0.0
if: ${{ always() }} # Ensure it runs regardless of success, failure or cancel
with:
title: ${{ env.COMMENT_TITLE }} # Use env to prevent duplication in the same workflow
status: ${{ job.status }} # The job.status (success, failure, cancelled) are valid
github_token: ${{ github.token }}
skylark_url: ${{ steps.deploy.outputs.url }}
# Create an array of URLs and convert to JSON
- uses: actions/github-script@v6
id: json
with:
result-encoding: string
script: |
const json = JSON.stringify([
{ label: "A Custom URL", value: "https://custom-url.com" },
{ emoji: "💥", label: "With Emoji", value: "https://custom-emoji-url.com" }
]);
return json;
- uses: skylark-platform/comment-url-on-pr@v1.0.0
with:
title: 'A title for the comment'
status: building
github_token: ${{ github.token }}
comment_id: 'my custom id'
additional_urls: ${{ steps.json.outputs.result }} # Pass in result of previous step
- Node 14+
The easiest way to develop features is to commit to a new branch and create a pull request - this way you'll see the comment added to your own pull request.
A good workflow is:
- Install dependencies:
npm ci
- Make changes
- Build the Action:
npm run build:all
- Commit and push to your branch
- Let the Action run itself and then see the comment created on the pull request - you might need to refresh the page.
- Eslint and Prettier for code styling
- Jest used for tests
- Husky runs a pre-commit hook to lint and run tests
On a push to the main
branch (either by a commit or a merged pull request) a GitHub Action is run that will:
- Build and package to ensure the
dist
directory is up to date - Commit the
dist
directory, if updated - Automatically create a new tag using the github-tag-action
All that is left to do is navigate to the releases
tab and create a new release.