-
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: init action repo with cookiecutter (#1)
- Loading branch information
1 parent
b9d7e86
commit 25f7999
Showing
18 changed files
with
2,348 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
indent_size = 2 | ||
indent_style = space | ||
insert_final_newline = true | ||
max_line_length = 120 | ||
trim_trailing_whitespace = true | ||
|
||
[*.sh] | ||
indent_size = 4 |
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: "Setup Environment" | ||
description: "Setting environment for the project" | ||
|
||
inputs: | ||
task-version: | ||
description: "Task version" | ||
required: true | ||
default: "3.33.1" | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Install Task | ||
uses: arduino/setup-task@v1 | ||
with: | ||
version: ${{ inputs.task-version }} |
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Check PR Title | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- reopened | ||
- synchronize | ||
- edited | ||
|
||
jobs: | ||
check-pr-title: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Commitlint PR Title | ||
uses: ovsds/commitlint-pr-title-action@v1 | ||
with: | ||
config_file: ./commitlint.config.js |
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Check PR | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- reopened | ||
- synchronize | ||
|
||
jobs: | ||
check-pr: | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: read | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Environment | ||
uses: ./.github/actions/setup_environment | ||
|
||
- name: Install Dependencies | ||
run: | | ||
task init | ||
- name: Lint PR | ||
run: | | ||
task lint |
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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: E2E | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- reopened | ||
- synchronize | ||
|
||
jobs: | ||
e2e-default: | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: read | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Test Run | ||
id: test-run | ||
uses: ./ | ||
with: | ||
placeholder: "test_placeholder" | ||
|
||
- name: Assert placeholder | ||
uses: nick-fields/assert-action@v2 | ||
with: | ||
actual: ${{ steps.test-run.outputs.placeholder }} | ||
expected: "test_placeholder" | ||
e2e: | ||
runs-on: ubuntu-latest | ||
if: always() && !cancelled() | ||
|
||
needs: | ||
- e2e-default | ||
|
||
steps: | ||
- name: Collect Results | ||
uses: ovsds/collect-needs-result-action@v1 | ||
with: | ||
needs_json: ${{ toJson(needs) }} | ||
skip_allowed: false |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: Push version tags | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
push-version-tags: | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: write | ||
|
||
steps: | ||
- name: Push Version Tags | ||
uses: ovsds/push-version-tags-action@v1 | ||
with: | ||
version: ${{ github.event.release.tag_name }} |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# OS | ||
.DS_Store | ||
|
||
# IDE | ||
.idea/ | ||
.vscode/ | ||
|
||
# Dependencies | ||
node_modules/ |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
npx --no -- commitlint --edit |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
npx lint-staged |
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
fund=false | ||
audit=false | ||
save-exact=true | ||
unsafe-perm=true | ||
engine-strict=true | ||
update-notifier=false |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
v20.15.1 |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2024 datalens-tech | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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 +1,49 @@ | ||
# fix-dubious-ownership-action | ||
# fix-dubious-ownership-action | ||
|
||
[![CI](https://github.com/datalens-tech/fix-dubious-ownership-action/workflows/Check%20PR/badge.svg)](https://github.com/datalens-tech/fix-dubious-ownership-action/actions?query=workflow%3A%22%22Check+PR%22%22) | ||
[![GitHub Marketplace](https://img.shields.io/badge/Marketplace-fix-dubious-ownership-action-blue.svg)](https://github.com/marketplace/actions/fix-dubious-ownership-action) | ||
|
||
fix-dubious-ownership-action | ||
|
||
## Usage | ||
|
||
### Example | ||
|
||
```yaml | ||
jobs: | ||
fix-dubious-ownership-action: | ||
permissions: | ||
contents: read | ||
|
||
steps: | ||
- name: fix-dubious-ownership-action | ||
id: fix-dubious-ownership-action | ||
uses: datalens-tech/fix-dubious-ownership-action@v1 | ||
``` | ||
### Action Inputs | ||
| Name | Description | Default | | ||
| ------------- | ------------ | ------- | | ||
| `placeholder` | Placeholder. | | | ||
|
||
### Action Outputs | ||
|
||
| Name | Description | | ||
| ------------- | ------------ | | ||
| `placeholder` | Placeholder. | | ||
|
||
## Development | ||
|
||
### Global dependencies | ||
|
||
- [Taskfile](https://taskfile.dev/installation/) | ||
- [nvm](https://github.com/nvm-sh/nvm?tab=readme-ov-file#install--update-script) | ||
|
||
### Taskfile commands | ||
|
||
For all commands see [Taskfile](Taskfile.yaml) or `task --list-all`. | ||
|
||
## License | ||
|
||
[MIT](LICENSE) |
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 |
---|---|---|
@@ -0,0 +1,76 @@ | ||
version: 3 | ||
|
||
silent: true | ||
|
||
vars: | ||
NENV: "node_modules" | ||
|
||
tasks: | ||
_prettier: | ||
internal: true | ||
cmds: | ||
- "{{.NENV}}/.bin/prettier {{.COMMAND}}" | ||
|
||
_with_nvm: | ||
internal: true | ||
cmds: | ||
- "source ${HOME}/.nvm/nvm.sh && nvm install && {{.COMMAND}}" | ||
|
||
init: | ||
desc: Initialize project environment | ||
cmds: | ||
- echo 'Installing node dependencies...' | ||
- task: _with_nvm | ||
vars: { COMMAND: "npm install" } | ||
|
||
- echo 'Installing husky pre-commit...' | ||
- task: _with_nvm | ||
vars: { COMMAND: "npm run prepare" } | ||
|
||
lint: | ||
desc: Lint project | ||
cmds: | ||
- task: _with_nvm | ||
vars: { COMMAND: "npm run lint:check" } | ||
|
||
lint-fix: | ||
desc: Lint fix project | ||
cmds: | ||
- task: _with_nvm | ||
vars: { COMMAND: "npm run lint:fix" } | ||
|
||
clean: | ||
desc: Clean project environment | ||
cmds: | ||
- echo 'Cleaning node dependencies...' | ||
- rm -rf {{.NENV}} | ||
|
||
dependencies-update: | ||
desc: Update dependencies | ||
cmds: | ||
- echo 'Updating node dependencies...' | ||
- task: _with_nvm | ||
vars: { COMMAND: "npm update" } | ||
- task: _with_nvm | ||
vars: { COMMAND: "npm outdated" } | ||
- task: _with_nvm | ||
vars: { COMMAND: "npm audit" } | ||
|
||
update-from-template: | ||
desc: Update project from template | ||
cmds: | ||
- echo 'Updating project from template...' | ||
- cookiecutter | ||
--no-input | ||
--overwrite-if-exists | ||
--output-dir ../ | ||
{{.TEMPLATE_PATH}} | ||
project_name='fix-dubious-ownership-action' | ||
project_slug='fix-dubious-ownership-action' | ||
marketplace_name='fix-dubious-ownership-action' | ||
action_type='composite' | ||
node_version='v20.15.1' | ||
owner_name='datalens-tech' | ||
owner_github_login='datalens-tech' | ||
vars: | ||
TEMPLATE_PATH: '{{.TEMPLATE_PATH | default "https://github.com/ovsds/template-repository-github-action"}}' |
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: "fix-dubious-ownership-action" | ||
description: "fix-dubious-ownership-action" | ||
|
||
inputs: | ||
placeholder: | ||
description: "Placeholder input to be replaced by real inputs" | ||
required: true | ||
default: "placeholder" | ||
|
||
outputs: | ||
placeholder: | ||
description: "Placeholder output to be replaced by real outputs" | ||
value: ${{steps.placeholder.outputs.placeholder }} | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Placeholder | ||
id: placeholder | ||
shell: bash | ||
run: | | ||
echo "::set-output name=placeholder::${{ inputs.placeholder }}" | ||
# https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#branding | ||
branding: | ||
icon: "message-square" | ||
color: "gray-dark" |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
"use strict"; | ||
|
||
module.exports = { extends: ["@commitlint/config-conventional"] }; |
Oops, something went wrong.