Skip to content

Commit

Permalink
docs: improve community pages (#25)
Browse files Browse the repository at this point in the history
Signed-off-by: Romain Lespinasse <[email protected]>
  • Loading branch information
rlespinasse authored Oct 26, 2024
1 parent eecf0dc commit 27d97cb
Show file tree
Hide file tree
Showing 5 changed files with 120 additions and 8 deletions.
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
33 changes: 33 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# How to contribute to Shortify Git Revision

## Did you find a bug

* **Do not open up a GitHub issue if the bug is a security vulnerability**, and instead to refer to our [security policy][1].

* **Ensure the bug was not already reported** by searching on GitHub under [Issues][2].

* If you're unable to find an open issue addressing the problem, [open a 'Bug' issue][4].
Be sure to include a **title and clear description**, as much relevant information as possible, and a **code sample** or an **executable test case** demonstrating the expected behavior that is not occurring.

## Did you write a patch that fixes a bug

* Open a new GitHub pull request with the patch.

* Ensure the PR description clearly describes the problem and solution.
Include the relevant issue number if applicable.

## Do you intend to add a new feature or change an existing one

* Suggest your change by [opening a 'Feature request' issue][5]

## Do you have questions about the source code

* [open an issue][3] with your question.

Thanks!

[1]: https://github.com/rlespinasse/shortify-git-revision/security/policy
[2]: https://github.com/rlespinasse/shortify-git-revision/issues
[3]: https://github.com/rlespinasse/shortify-git-revision/issues/new
[4]: https://github.com/rlespinasse/shortify-git-revision/issues/new?assignees=&labels=bug&template=bug_report.md&title=
[5]: https://github.com/rlespinasse/shortify-git-revision/issues/new?assignees=&labels=enhancement&template=feature_request.md&title=
30 changes: 22 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
# Shortify git revision

> Github Action to shortify a git revision
> [!NOTE]
> A GitHub Action that generates shortened Git revision identifiers from full-length commit hashes and exposes them as environment variables.
Produce short revision environment variable based on the input one.
## Features

If a revision is a bad revision, this action will produce an error message and fail depending on `continue-on-error` input (This behavior can be override with `short-on-error` input).
`<NAME>`, and `<NAME>_SHORT` environment variable will only be available if the revision is not empty and valid.
- Converts full Git revisions into their shortened form
- Validates revision format and handles invalid inputs
- Provides both full and shortened revisions as environment variables
- Configurable error handling for invalid revisions

## Behavior

- Creates `<NAME>` and `<NAME>_SHORT` environment variables for valid revisions
- Environment variables are only set when the input revision is non-empty and valid
- Handles invalid revisions based on configuration:
- Fails by default (controlled by `continue-on-error` input)
- Can be customized using `short-on-error` input to override default behavior

## Usage

Expand Down Expand Up @@ -85,8 +96,9 @@ If a revision is a bad revision, this action will produce an error message and f

### `name`

If used with `revision` input, it's the name of the environment variable containing the revision to shortify.
Otherwise, the `name` input will be used (in upper case) to define a environment variable containing the `revision` input value.
When providing a `revision` through the revision input, the action will use this environment variable name to store the shortened hash.

If no environment variable is specified, the action automatically creates one using the `name` input (converted to uppercase) to store the provided `revision` value.

### `revision`

Expand All @@ -106,8 +118,10 @@ If the input is set to `true`, this action will short a bad revision

The default value is `false`.

> If this input is set to `true`, the input `continue-on-error` input will be ignored.
> If this input is set to `true`, the input `length` input is mandatory.
> [!WARNING]
>
> - If this input is set to `true`, the input `continue-on-error` input will be ignored.
> - If this input is set to `true`, the input `length` input is mandatory.

### `prefix`

Expand Down
22 changes: 22 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Security Policy

## Supported Versions and Branches

| Version | Supported | End of Support | Branch | Specific Tags |
| ------- | ------------------ | -------------- | ------ | ------------- |
| 1.x | :white_check_mark: | | v1.x | v1 |

A GitHub repository can use one of the available branches as an action inside its workflows.

### End of Life of a branch

Since `2024-10-26`, when a new major version is released,

- The previous one will continue to receive security patches for 3 months,
- After the 3 months, the branch is deleted, and only the tags remain.

## Reporting a Vulnerability

In this project, you can report a Vulnerability by creating a [draft security advisory](https://github.com/rlespinasse/shortify-git-revision/security/advisories).

If the vulnerability is confirmed, a fix will be produced and the advisory will be published.

0 comments on commit 27d97cb

Please sign in to comment.