-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(workflows): make workflows reusable (#10)
- Loading branch information
Showing
8 changed files
with
259 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,66 @@ | ||
# Workflow - Greetings | ||
<!-- start title --> | ||
|
||
# GitHub Reusable Workflow: Greetings | ||
|
||
<!-- end title --> | ||
<!-- start description --> | ||
|
||
Workflow to greet new contributors. | ||
Mainly using [First Interaction Action](https://github.com/actions/first-interaction), with some opinionated defaults. | ||
|
||
- On issue creation, a comment is added to the issue. | ||
- On first contribution, a comment is added to the pull request. | ||
|
||
## Usage | ||
<!-- end description --> | ||
<!-- start contents --> | ||
<!-- end contents --> | ||
<!-- start usage --> | ||
|
||
```yaml | ||
name: Mark stale issues and pull requests | ||
|
||
on: | ||
schedule: | ||
- cron: "30 1 * * *" | ||
|
||
jobs: | ||
main: | ||
uses: hoverkraft-tech/ci-github-common/.github/workflows/greetings.yml@main | ||
secrets: | ||
# Token for the repository. Can be passed in using "${{ secrets.GITHUB_TOKEN }}". | ||
# See https://github.com/actions/first-interaction#usage | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
# Optional customizations. | ||
with: | ||
# Comment to post on an individual's first issue. | ||
# See https://github.com/actions/first-interaction#usage | ||
# Default: "Hi, thank for reporting an issue, we will check it out very soon" | ||
issue-message: "" | ||
# Comment to post on an individual's first pull request. | ||
# See https://github.com/actions/first-interaction#usage | ||
# Default: "Hi, thank you for creating your PR, we will check it out very soon" | ||
pr-message: "" | ||
``` | ||
<!-- end usage --> | ||
<!-- start secrets --> | ||
| **Secret** | **Description** | | ||
| ----------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | | ||
| **<code>github-token</code>** | Token for the repository. Can be passed in using "${{ secrets.GITHUB_TOKEN }}". See https://github.com/actions/first-interaction#usage | | ||
<!-- end secrets --> | ||
<!-- start inputs --> | ||
### As required workflow | ||
| **Input** | **Description** | **Default** | **Required** | | ||
| ------------------------------ | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------ | | ||
| **<code>issue-message</code>** | Comment to post on an individual's first issue. See https://github.com/actions/first-interaction#usage | <code>Hi, thank for reporting an issue, we will check it out very soon</code> | **false** | | ||
| **<code>issue-message</code>** | Comment to post on an individual's first pull request. See https://github.com/actions/first-interaction#usage | <code>Hi, thank you for creating your PR, we will check it out very soon</code> | **false** | | ||
Configure workflow to be required in your organization settings. | ||
<!-- end inputs --> | ||
- Go to your organization actions settings to add a new required workflow: Settings > Actions > General > Required workflows > Add workflow | ||
`https://github.com/organizations/[your-organization]/settings/actions/required_workflows/new` (replace `[your-organization]` with your organization name) | ||
- Select the repository `ci-github-common` | ||
- Select the workflow file: `.github/workflows/greetings.yml` | ||
- Add workflow | ||
<!-- start outputs --> | ||
<!-- end outputs --> | ||
<!-- start [.github/ghadocs/examples/] --> | ||
<!-- end [.github/ghadocs/examples/] --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,51 @@ | ||
# Workflow - Semantic pull request | ||
<!-- start title --> | ||
|
||
# GitHub Reusable Workflow: Semantic pull request | ||
|
||
<!-- end title --> | ||
<!-- start description --> | ||
|
||
Workflow to ensure "Squash and merge" Pull Request strategy provides a valid commit message. | ||
Check that the title follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification. | ||
Mainly using [action-semantic-pull-request](https://github.com/amannn/action-semantic-pull-request#installation), with some opinionated defaults. | ||
|
||
<!-- end description --> | ||
<!-- start contents --> | ||
<!-- end contents --> | ||
<!-- start usage --> | ||
|
||
```yaml | ||
name: "Pull Request - Semantic Lint" | ||
|
||
on: | ||
pull_request_target: | ||
types: | ||
- opened | ||
- edited | ||
- synchronize | ||
|
||
jobs: | ||
main: | ||
uses: hoverkraft-tech/ci-github-common/.github/workflows/semantic-pull-request.yml@main | ||
secrets: | ||
# Token for the repository. Can be passed in using "${{ secrets.GITHUB_TOKEN }}". | ||
# See https://github.com/amannn/action-semantic-pull-request#installation | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
``` | ||
<!-- end usage --> | ||
<!-- start secrets --> | ||
## Usage | ||
| **Secret** | **Description** | | ||
| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| **<code>github-token</code>** | Token for the repository. Can be passed in using "${{ secrets.GITHUB_TOKEN }}". See https://github.com/amannn/action-semantic-pull-request#installation | | ||
### As required workflow | ||
<!-- end secrets --> | ||
<!-- start inputs --> | ||
Configure workflow to be required in your organization settings. | ||
<!-- end inputs --> | ||
- Go to your organization actions settings to add a new required workflow: Settings > Actions > General > Required workflows > Add workflow | ||
`https://github.com/organizations/[your-organization]/settings/actions/required_workflows/new` (replace `[your-organization]` with your organization name) | ||
- Select the repository `ci-github-common` | ||
- Select the workflow file: `.github/workflows/semantic-pull-request.yml` | ||
- Add workflow | ||
<!-- start outputs --> | ||
<!-- end outputs --> | ||
<!-- start [.github/ghadocs/examples/] --> | ||
<!-- end [.github/ghadocs/examples/] --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,76 @@ | ||
# Workflow - Stale | ||
<!-- start title --> | ||
|
||
Workflow to mark issues and pull requests as stale when needed. | ||
# GitHub Reusable Workflow: Stale | ||
|
||
- First add labels to issues and pull requests to mark them as stale. | ||
- Then add a comment to the issue or pull request to explain why it is marked as stale. | ||
- Finally, close the issue or pull request if it is still stale after a given period of time. | ||
<!-- end title --> | ||
<!-- start description --> | ||
|
||
## Usage | ||
Reusable workflow to manage stale issues and pull requests. | ||
Mainly using [Stale Action](https://github.com/actions/stale), with some opinionated defaults. | ||
|
||
### As required workflow | ||
<!-- end description --> | ||
<!-- start contents --> | ||
<!-- end contents --> | ||
<!-- start usage --> | ||
|
||
Configure workflow to be required in your organization settings. | ||
```yaml | ||
name: Mark stale issues and pull requests | ||
|
||
- Go to your organization actions settings to add a new required workflow: Settings > Actions > General > Required workflows > Add workflow | ||
`https://github.com/organizations/[your-organization]/settings/actions/required_workflows/new` (replace `[your-organization]` with your organization name) | ||
- Select the repository `ci-github-common` | ||
- Select the workflow file: `.github/workflows/stale.yml` | ||
- Add workflow | ||
on: | ||
schedule: | ||
- cron: "30 1 * * *" | ||
|
||
jobs: | ||
main: | ||
uses: hoverkraft-tech/ci-github-common/.github/workflows/stale.yml@main | ||
|
||
# Optional customizations. | ||
with: | ||
# Comment on the staled issues. | ||
# See https://github.com/actions/stale#stale-issue-message | ||
# Default: "This issue is stale" | ||
stale-issue-message: "" | ||
|
||
# Comment on the staled PRs. | ||
# See https://github.com/actions/stale#stale-pr-message | ||
# Default: "This PR is stale" | ||
stale-pr-message: "" | ||
|
||
# Label to apply on staled issues. | ||
# See https://github.com/actions/stale#stale-issue-label | ||
# Default: "no-issue-activity" | ||
stale-issue-label: "" | ||
|
||
# Labels on issues exempted from stale. | ||
# See https://github.com/actions/stale#exempt-issue-labels | ||
# Default: "awaiting-approval,work-in-progress" | ||
exempt-issue-labels: "" | ||
|
||
# Label to apply on staled PRs. | ||
# See https://github.com/actions/stale#stale-pr-label | ||
# Default: "no-pr-activity" | ||
stale-pr-label: "" | ||
|
||
# Labels on PRs exempted from stale. | ||
# See https://github.com/actions/stale#exempt-pr-labels | ||
# Default: "awaiting-approval,work-in-progress" | ||
exempt-pr-labels: "" | ||
``` | ||
<!-- end usage --> | ||
<!-- start inputs --> | ||
| **Input** | **Description** | **Default** | **Required** | | ||
| ------------------------------------ | ---------------------------------------------------------------------------------------------- | ----------------------------------------------- | ------------ | | ||
| **<code>stale-issue-message</code>** | Comment on the staled issues. See https://github.com/actions/stale#stale-issue-message | <code>This issue is stale</code> | **false** | | ||
| **<code>stale-pr-message</code>** | Comment on the staled PRs. See https://github.com/actions/stale#stale-pr-message | <code>This PR is stale</code> | **false** | | ||
| **<code>stale-issue-label</code>** | Label to apply on staled issues. See https://github.com/actions/stale#stale-issue-label | <code>no-issue-activity</code> | **false** | | ||
| **<code>exempt-issue-labels</code>** | Labels on issues exempted from stale. See https://github.com/actions/stale#exempt-issue-labels | <code>awaiting-approval,work-in-progress</code> | **false** | | ||
| **<code>stale-pr-label</code>** | Label to apply on staled PRs. See https://github.com/actions/stale#stale-pr-label | <code>no-pr-activity</code> | **false** | | ||
| **<code>exempt-pr-labels</code>** | Labels on PRs exempted from stale. See https://github.com/actions/stale#exempt-pr-labels | <code>awaiting-approval,work-in-progress</code> | **false** | | ||
<!-- end inputs --> | ||
<!-- start outputs --> | ||
<!-- end outputs --> | ||
<!-- start [.github/ghadocs/examples/] --> | ||
<!-- end [.github/ghadocs/examples/] --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters