This action slugifies the commit ref (branch or tag name) similar to what Gitlab uses. It also sets a shortened commit SHA.
Slugify
will get the branch name for push
and pull_request
events and then process it as follows:
sha_length
:
branch
:
description: 'The slugified branch'
sha
:
Define a workflow in .github/workflows/continuous-integration.yml
(or add a job if you already have defined workflows).
:bulb: Read more about Configuring a workflow.
on:
pull_request:
push:
branches:
- main
tags:
- "**"
name: "Continuous Integration"
jobs:
github-action-template:
name: github-action-template
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@v3
- name: "Run slugify"
id: slugify
uses: eltimn/slugify-action@v2
- name: "Echo slugify outputs"
run: |
echo ${{steps.slugify.outputs.branch}}-${{steps.slugify.outputs.sha}}
This package is licensed using the MIT
Run npm run package
to create a distribution artifact.