Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
dmaklygin committed Jun 14, 2022
0 parents commit 2eef55e
Show file tree
Hide file tree
Showing 70 changed files with 24,544 additions and 0 deletions.
1 change: 1 addition & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
extends @toptal/browserslist-config
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": ["@changesets/changelog-github", { "repo": "toptal/davinci-github-actions" }],
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"baseBranch": "master",
"updateInternalDependencies": "patch",
"ignore": []
}
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true

# Consistent 2 space indentation
[*]
indent_style = space
indent_size = 2
trim_trailing_whitespace = true

[*.ejs.t]
insert_final_newline = false
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/dist
/node_modules
/reports
**/dist/**
11 changes: 11 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": "./node_modules/@toptal/davinci-syntax/src/configs/.eslintrc",
"rules": {
"id-length": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-unused-vars": ["error", { "varsIgnorePattern": "__", "argsIgnorePattern": "^_" }],
"complexity": "off",
"max-lines-per-function": "off",
"padding-line-between-statements": "off"
}
}
10 changes: 10 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# This file defines individuals or teams that are responsible for code.
#
# https://github.com/blog/2392-introducing-code-owners
# https://help.github.com/articles/about-codeowners/
#
# Lines starting with '#' are comments.
# Each line is a file pattern followed by one or more owners.

# These owners will be the default owners for everything in the repo.
* @toptal/frontend-experience-eng
14 changes: 14 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[FX-NNNN]

### Description

Describe the changes and motivations for the pull request, unless evident from the title.

### How to test

- FIXME: Add the steps describing how to verify your changes

### Review

- [ ] Ensure that new GH Action have a README.md file
- [ ] Ensure that `yarn documentation:generate` was executed
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: weekly
open-pull-requests-limit: 4
pull-request-branch-name:
separator: "-"
labels:
- no-jira
- dependencies
- github-actions
29 changes: 29 additions & 0 deletions .github/workflows/handle-contribution.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Handle contribution

on:
pull_request:
types: [opened, reopened, ready_for_review]
branches:
- master

jobs:
call-notify-jira-about-contribution:
if: ${{ github.event.pull_request.head.ref != 'changeset-release/master' }}
runs-on: ubuntu-latest
name: Call notify jira about contribution
steps:
- uses: actions/checkout@v2
with:
repository: toptal/davinci-github-actions
ref: v2.0.4
token: ${{ secrets.TOPTAL_DEVBOT_TOKEN }}
path: ./.github/actions/

- uses: ./.github/actions/notify-jira-about-contribution
with:
team: frontend-experience-eng
repo: ${{ github.event.repository.name }}
pull-number: ${{ github.event.pull_request.number}}
jira-hook: ${{ secrets.JIRA_AUTOMATION_HOOK_FOR_NEW_CONTRIBUTION }}
github-token: ${{ secrets.TOPTAL_DEVBOT_TOKEN }}

62 changes: 62 additions & 0 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: PR Checks

on:
pull_request:
types: [opened, reopened, ready_for_review, synchronize]
branches: [master]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
readme-existence:
name: "README.md file existence check"
runs-on: [ 'org/toptal', 'os/linux', 'arch/x64', 'size/large' ]
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Check README.md file existence
run: |
for f in [^node_modules]*/ ; do
if [[ ! -f "$f/README.md" ]]
then
echo "README.md file does not exist in path: $f/README.md"
exit 1
break
fi
done
unit-tests:
name: Unit Tests
runs-on: [ 'org/toptal', 'os/linux', 'arch/x64', 'size/large' ]
if: ${{ github.event.pull_request.head.ref != 'changeset-release/master' }}
steps:
- name: Checkout Repo
uses: actions/[email protected]
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Setup Node.js 16.x
uses: actions/[email protected]
with:
node-version: 16.x

- uses: ./yarn-install

- uses: ./unit-tests

trufflehog-scan:
name: Trufflehog Scan
runs-on: [ 'org/toptal', 'os/linux', 'arch/x64', 'size/large' ]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
ref: ${{ github.head_ref }}

- name: trufflehog-actions-scan
uses: edplato/[email protected]
94 changes: 94 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: Release

on:
push:
branches:
- master

env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
GITHUB_WORKFLOW_URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/[email protected]
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0
# This forces changesets to use git user, provided by GITHUB_TOKEN env var
persist-credentials: false

- name: Setup node
uses: actions/[email protected]
with:
node-version: '14.17'

- uses: ./yarn-install

- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/[email protected]
with:
publish: yarn release
commit: 'chore: version packages'
env:
GITHUB_TOKEN: ${{ secrets.TOPTAL_BUILD_BOT_TOKEN }}

- name: Add no-jira label to "Version Package" PR
if: ${{ steps.changesets.outputs.published != 'true' }}
uses: actions/github-script@v6
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
// Get list of all open PRs with
// head branch "changeset-release/master"
// (there should be max 1 PR with such condition)
const { data } = await github.rest.pulls.list({
owner: 'toptal',
repo: 'davinci-github-actions',
state: 'open',
head: 'toptal:changeset-release/master'
})
// add to all of them label "no-jira"
for await (let pr of data) {
github.rest.issues.addLabels({
owner: 'toptal',
repo: 'davinci-github-actions',
issue_number: pr.number,
labels: [
'no-jira'
]
})
}
- name: Send a Slack notification on failure
if: ${{ failure() }}
uses: slackapi/[email protected]
with:
channel-id: '-frontend-exp-team-notifications'
slack-message: ":x: <!here> Current master version of davinci-github-actions is <${{ env.GITHUB_WORKFLOW_URL }}|broken>."
env:
SLACK_BOT_TOKEN: ${{ env.SLACK_BOT_TOKEN }}

- name: Send a Slack notification on success release
if: ${{ success() && steps.changesets.outputs.published == 'true' }}
uses: slackapi/[email protected]
with:
channel-id: '-frontend-exp-team-notifications'
slack-message: "Current master version of davinci-github-actions successfully released :green_heart:"
env:
SLACK_BOT_TOKEN: ${{ env.SLACK_BOT_TOKEN }}

- name: Send a Slack notification on success PR merge
if: ${{ success() && steps.changesets.outputs.published != 'true'}}
uses: slackapi/[email protected]
with:
channel-id: '-frontend-exp-team-notifications'
slack-message: "A new PR was merged to davinci-github-actions :parrotspin:"
env:
SLACK_BOT_TOKEN: ${{ env.SLACK_BOT_TOKEN }}
33 changes: 33 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# IDEs
.idea

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build
/dist
/dist-package
/reports

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*

# env
.envrc

anvil_test_results.json
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn lint-staged
3 changes: 3 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
...require('@toptal/davinci-syntax/src/configs/.prettierrc.js')
}
Loading

0 comments on commit 2eef55e

Please sign in to comment.