diff --git a/.github/boomper.yml b/.github/boomper.yml index 2a330b5009..2ea71de604 100644 --- a/.github/boomper.yml +++ b/.github/boomper.yml @@ -1,3 +1,3 @@ updates: -- path: README.md - pattern: 'uses = "release-drafter/release-drafter@(.*)"' + - path: README.md + pattern: 'uses = "release-drafter/release-drafter@(.*)"' diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 73041e5ce6..05e1c0815d 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -6,16 +6,16 @@ jobs: eslint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 1 - - uses: actions/setup-node@v1 - with: - version: 13.x - - run: yarn --frozen-lockfile --ignore-engines --ignore-optional --no-bin-links --non-interactive --silent --ignore-scripts --production=false - env: - HUSKY_SKIP_INSTALL: true - - uses: tinovyatkin/action-eslint@v1 - with: - repo-token: ${{secrets.GITHUB_TOKEN}} - check-name: eslint + - uses: actions/checkout@v2 + with: + fetch-depth: 1 + - uses: actions/setup-node@v1 + with: + version: 13.x + - run: yarn --frozen-lockfile --ignore-engines --ignore-optional --no-bin-links --non-interactive --silent --ignore-scripts --production=false + env: + HUSKY_SKIP_INSTALL: true + - uses: tinovyatkin/action-eslint@v1 + with: + repo-token: ${{secrets.GITHUB_TOKEN}} + check-name: eslint diff --git a/.github/workflows/rebase.yml b/.github/workflows/rebase.yml index 9025bf4828..ae80c3214e 100644 --- a/.github/workflows/rebase.yml +++ b/.github/workflows/rebase.yml @@ -1,4 +1,4 @@ -on: +on: issue_comment: types: [created] name: Automatic Rebase @@ -8,13 +8,13 @@ jobs: if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/rebase') runs-on: ubuntu-latest steps: - - uses: actions/checkout@master - with: - fetch-depth: 0 - - name: Automatic Rebase - uses: cirrus-actions/rebase@1.2 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - uses: actions/checkout@master + with: + fetch-depth: 0 + - name: Automatic Rebase + uses: cirrus-actions/rebase@1.2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # https://github.community/t5/GitHub-Actions/Workflow-is-failing-if-no-job-can-be-ran-due-to-condition/m-p/38186#M3250 always_job: name: Always run job diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9b8975958e..151b6b086d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -6,11 +6,11 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@master - - uses: actions/setup-node@v1 - with: - version: 13.x - - name: Test - run: | - yarn install - yarn test + - uses: actions/checkout@master + - uses: actions/setup-node@v1 + with: + version: 13.x + - name: Test + run: | + yarn install + yarn test diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000000..95988100b5 --- /dev/null +++ b/.prettierignore @@ -0,0 +1 @@ +config-with-yaml-exception.yml diff --git a/.travis.yml b/.travis.yml index 0c28bcbf7a..f69e486aac 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,4 +2,4 @@ language: minimal sudo: required services: - docker -script: docker-compose run app npm test \ No newline at end of file +script: docker-compose run app npm test diff --git a/.vscode/launch.json b/.vscode/launch.json index 9a3efa0826..70d6af97b6 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -41,11 +41,7 @@ "windows": { "program": "${workspaceFolder}/node_modules/jest/bin/jest" }, - "args": [ - "${fileBasenameNoExtension}", - "-t", - "${selectedText}" - ], - }, + "args": ["${fileBasenameNoExtension}", "-t", "${selectedText}"] + } ] } diff --git a/action.yml b/action.yml index c1a44cc8c8..4d723fc3c1 100644 --- a/action.yml +++ b/action.yml @@ -5,4 +5,4 @@ runs: image: 'Dockerfile' branding: icon: edit-2 - color: orange + color: orange diff --git a/app.yml b/app.yml index 884bff5470..9ff07d38c6 100644 --- a/app.yml +++ b/app.yml @@ -1,139 +1,8 @@ -# This is a GitHub App Manifest. These settings will be used by default when -# initially configuring your GitHub App. -# -# NOTE: changing this file will not update your GitHub App settings. -# You must visit github.com/settings/apps/your-app-name to edit them. -# -# Read more about configuring your GitHub App: -# https://probot.github.io/docs/development/#configuring-a-github-app -# -# Read more about GitHub App Manifests: -# https://developer.github.com/apps/building-github-apps/creating-github-apps-from-a-manifest/ - -# The list of events the GitHub App subscribes to. -# Uncomment the event names below to enable them. default_events: -# - check_run -# - check_suite -# - commit_comment -# - create -# - delete -# - deployment -# - deployment_status -# - fork -# - gollum -# - issue_comment -# - issues -# - label -# - milestone -# - member -# - membership -# - org_block -# - organization -# - page_build -# - project -# - project_card -# - project_column -# - public -# - pull_request -# - pull_request_review -# - pull_request_review_comment -- push -# - release -# - repository -# - repository_import -# - status -# - team -# - team_add -# - watch - -# The set of permissions needed by the GitHub App. The format of the object uses -# the permission name for the key (for example, issues) and the access type for -# the value (for example, write). -# Valid values are `read`, `write`, and `none` + - push default_permissions: - # Repository creation, deletion, settings, teams, and collaborators. - # https://developer.github.com/v3/apps/permissions/#permission-on-administration - # administration: read - - # Checks on code. - # https://developer.github.com/v3/apps/permissions/#permission-on-checks - # checks: write - - # Repository contents, commits, branches, downloads, releases, and merges. - # https://developer.github.com/v3/apps/permissions/#permission-on-contents contents: write - - # Deployments and deployment statuses. - # https://developer.github.com/v3/apps/permissions/#permission-on-deployments - # deployments: read - - # Issues and related comments, assignees, labels, and milestones. - # https://developer.github.com/v3/apps/permissions/#permission-on-issues - # issues: write - - # Search repositories, list collaborators, and access repository metadata. - # https://developer.github.com/v3/apps/permissions/#metadata-permissions metadata: read - - # Retrieve Pages statuses, configuration, and builds, as well as create new builds. - # https://developer.github.com/v3/apps/permissions/#permission-on-pages - # pages: read - - # Pull requests and related comments, assignees, labels, milestones, and merges. - # https://developer.github.com/v3/apps/permissions/#permission-on-pull-requests pull_requests: read - - # Manage the post-receive hooks for a repository. - # https://developer.github.com/v3/apps/permissions/#permission-on-repository-hooks - # repository_hooks: read - - # Manage repository projects, columns, and cards. - # https://developer.github.com/v3/apps/permissions/#permission-on-repository-projects - # repository_projects: read - - # Retrieve security vulnerability alerts. - # https://developer.github.com/v4/object/repositoryvulnerabilityalert/ - # vulnerability_alerts: read - - # Commit statuses. - # https://developer.github.com/v3/apps/permissions/#permission-on-statuses - # statuses: read - - # Organization members and teams. - # https://developer.github.com/v3/apps/permissions/#permission-on-members - # members: read - - # View and manage users blocked by the organization. - # https://developer.github.com/v3/apps/permissions/#permission-on-organization-user-blocking - # organization_user_blocking: read - - # Manage organization projects, columns, and cards. - # https://developer.github.com/v3/apps/permissions/#permission-on-organization-projects - # organization_projects: read - - # Manage team discussions and related comments. - # https://developer.github.com/v3/apps/permissions/#permission-on-team-discussions - # team_discussions: read - - # Manage the post-receive hooks for an organization. - # https://developer.github.com/v3/apps/permissions/#permission-on-organization-hooks - # organization_hooks: read - - # Get notified of, and update, content references. - # https://developer.github.com/v3/apps/permissions/ - # organization_administration: read - - -# The name of the GitHub App. Defaults to the name specified in package.json -# name: My Probot App - -# The homepage of your GitHub App. url: https://github.com/wolfeidau/release-drafter-serverless - -# A description of the GitHub App. -# description: A description of my awesome app - -# Set to true when your GitHub App is available to the public or false when it is only accessible to the owner of the app. -# Default: true public: true diff --git a/docker-compose.yml b/docker-compose.yml index 14facfbc20..a099147086 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,4 @@ -version: "3.4" +version: '3.4' services: # We override much of the default GitHub Actions oriented Dockerfile for # making it easier to run the tests using Docker Compose @@ -8,4 +8,4 @@ services: args: NODE_ENV: development command: ['npm', 'test'] - entrypoint: '' \ No newline at end of file + entrypoint: '' diff --git a/lib/releases.js b/lib/releases.js index 37a289a2b0..ed1702c8eb 100644 --- a/lib/releases.js +++ b/lib/releases.js @@ -289,7 +289,6 @@ module.exports.updateRelease = ({ draftRelease, releaseInfo, shouldDraft, - config, }) => { const updateReleaseParams = updateDraftReleaseParams({ name: releaseInfo.name || draftRelease.name, diff --git a/package.json b/package.json index e11c207a6a..30d614f5e6 100644 --- a/package.json +++ b/package.json @@ -12,8 +12,8 @@ "test:watch": "jest --watch --notify --notifyMode=change --coverage", "generate-schema": "node ./bin/generate-schema.js print", "generate-fixtures": "node ./bin/generate-fixtures.js", - "lint": "eslint '**/*.js'", - "prettier": "prettier --write **/*.{js,md,json}", + "lint": "eslint **/*.js", + "prettier": "prettier --write **/*.{js,md,json,yml,yaml}", "postversion": "npm run test && git push && git push --tags && npm publish && npm run deploy && npm run open-releases", "open-releases": "open \"$(node -e 'console.log(`${require(\"./package.json\").repository}/releases`)')\"", "deploy": "git push -f heroku \"$(node -e 'console.log(`v${require(\"./package.json\").version}`)')\":master" diff --git a/test/fixtures/config/config-non-master-branch.yml b/test/fixtures/config/config-non-master-branch.yml index 87e251d46d..636da76ed0 100644 --- a/test/fixtures/config/config-non-master-branch.yml +++ b/test/fixtures/config/config-non-master-branch.yml @@ -3,4 +3,4 @@ branches: template: | # What's Changed - $CHANGES \ No newline at end of file + $CHANGES diff --git a/test/fixtures/config/config-previous-tag.yml b/test/fixtures/config/config-previous-tag.yml index 5161284cc4..1c7492b207 100644 --- a/test/fixtures/config/config-previous-tag.yml +++ b/test/fixtures/config/config-previous-tag.yml @@ -1,5 +1,5 @@ template: | Changes: $CHANGES - + Previous tag: '$PREVIOUS_TAG' diff --git a/test/fixtures/config/config-with-categories.yml b/test/fixtures/config/config-with-categories.yml index 413acef927..8f862586cd 100644 --- a/test/fixtures/config/config-with-categories.yml +++ b/test/fixtures/config/config-with-categories.yml @@ -7,4 +7,4 @@ categories: - label: feature title: 🚀 Features - label: fix - title: 🐛 Bug Fixes \ No newline at end of file + title: 🐛 Bug Fixes diff --git a/test/fixtures/config/config-with-changes-templates.yml b/test/fixtures/config/config-with-changes-templates.yml index 6f494e8ff5..2a48439130 100644 --- a/test/fixtures/config/config-with-changes-templates.yml +++ b/test/fixtures/config/config-with-changes-templates.yml @@ -1,3 +1,3 @@ template: '$CHANGES' no-changes-template: '* No changes mmkay' -change-template: "* Change: #$NUMBER '$TITLE' @$AUTHOR" \ No newline at end of file +change-template: "* Change: #$NUMBER '$TITLE' @$AUTHOR" diff --git a/test/fixtures/config/config-with-contributors.yml b/test/fixtures/config/config-with-contributors.yml index 4d0e7110cb..4676aa8a20 100644 --- a/test/fixtures/config/config-with-contributors.yml +++ b/test/fixtures/config/config-with-contributors.yml @@ -1 +1 @@ -template: "A big thanks to: $CONTRIBUTORS" \ No newline at end of file +template: 'A big thanks to: $CONTRIBUTORS' diff --git a/test/fixtures/config/config-with-custom-version-resolver-major.yml b/test/fixtures/config/config-with-custom-version-resolver-major.yml index 2cbb0fee10..4435f1a2e7 100644 --- a/test/fixtures/config/config-with-custom-version-resolver-major.yml +++ b/test/fixtures/config/config-with-custom-version-resolver-major.yml @@ -25,4 +25,4 @@ version-resolver: - 'patch' default: minor exclude-labels: - - skip-changelog \ No newline at end of file + - skip-changelog diff --git a/test/fixtures/config/config-with-custom-version-resolver-minor.yml b/test/fixtures/config/config-with-custom-version-resolver-minor.yml index d2fcf10bca..caa3874929 100644 --- a/test/fixtures/config/config-with-custom-version-resolver-minor.yml +++ b/test/fixtures/config/config-with-custom-version-resolver-minor.yml @@ -25,4 +25,4 @@ version-resolver: - 'patch' default: minor exclude-labels: - - skip-changelog \ No newline at end of file + - skip-changelog diff --git a/test/fixtures/config/config-with-custom-version-resolver-none.yml b/test/fixtures/config/config-with-custom-version-resolver-none.yml index 64f1623608..7257717e3d 100644 --- a/test/fixtures/config/config-with-custom-version-resolver-none.yml +++ b/test/fixtures/config/config-with-custom-version-resolver-none.yml @@ -25,4 +25,4 @@ version-resolver: - 'PAT' default: minor exclude-labels: - - skip-changelog \ No newline at end of file + - skip-changelog diff --git a/test/fixtures/config/config-with-custom-version-resolver-patch.yml b/test/fixtures/config/config-with-custom-version-resolver-patch.yml index 04aac55f87..0754092980 100644 --- a/test/fixtures/config/config-with-custom-version-resolver-patch.yml +++ b/test/fixtures/config/config-with-custom-version-resolver-patch.yml @@ -25,4 +25,4 @@ version-resolver: - 'patch' default: minor exclude-labels: - - skip-changelog \ No newline at end of file + - skip-changelog diff --git a/test/fixtures/config/config-with-major-minor-patch-version-template.yml b/test/fixtures/config/config-with-major-minor-patch-version-template.yml index 170959d363..2eb59b6d13 100644 --- a/test/fixtures/config/config-with-major-minor-patch-version-template.yml +++ b/test/fixtures/config/config-with-major-minor-patch-version-template.yml @@ -1,4 +1,4 @@ template: Placeholder with example. Automatically calculated values are next major=$NEXT_MAJOR_VERSION, minor=$NEXT_MINOR_VERSION, patch=$NEXT_PATCH_VERSION -name-template: "v$NEXT_PATCH_VERSION (Code name: Placeholder)" +name-template: 'v$NEXT_PATCH_VERSION (Code name: Placeholder)' tag-template: v$NEXT_PATCH_VERSION version-template: $MAJOR.$MINOR.$PATCH diff --git a/test/fixtures/config/config-with-major-minor-version-template.yml b/test/fixtures/config/config-with-major-minor-version-template.yml index 48afb3df1e..f9a6f8b858 100644 --- a/test/fixtures/config/config-with-major-minor-version-template.yml +++ b/test/fixtures/config/config-with-major-minor-version-template.yml @@ -1,4 +1,4 @@ template: Placeholder with example. Automatically calculated values are next major=$NEXT_MAJOR_VERSION, minor=$NEXT_MINOR_VERSION, patch=$NEXT_PATCH_VERSION -name-template: "v$NEXT_MINOR_VERSION (Code name: Placeholder)" +name-template: 'v$NEXT_MINOR_VERSION (Code name: Placeholder)' tag-template: v$NEXT_MINOR_VERSION version-template: $MAJOR.$MINOR diff --git a/test/fixtures/config/config-with-major-version-template.yml b/test/fixtures/config/config-with-major-version-template.yml index 0c3663cad7..2dfae7ab67 100644 --- a/test/fixtures/config/config-with-major-version-template.yml +++ b/test/fixtures/config/config-with-major-version-template.yml @@ -1,4 +1,4 @@ template: Placeholder with example. Automatically calculated values are next major=$NEXT_MAJOR_VERSION, minor=$NEXT_MINOR_VERSION, patch=$NEXT_PATCH_VERSION -name-template: "v$NEXT_MAJOR_VERSION (Code name: Placeholder)" +name-template: 'v$NEXT_MAJOR_VERSION (Code name: Placeholder)' tag-template: v$NEXT_MAJOR_VERSION version-template: $MAJOR diff --git a/test/fixtures/config/config-with-next-versioning.yml b/test/fixtures/config/config-with-next-versioning.yml index fd52e5ea9d..769f1e7d1b 100644 --- a/test/fixtures/config/config-with-next-versioning.yml +++ b/test/fixtures/config/config-with-next-versioning.yml @@ -1,3 +1,3 @@ template: Placeholder with example. Automatically calculated values are next major=$NEXT_MAJOR_VERSION, minor=$NEXT_MINOR_VERSION, patch=$NEXT_PATCH_VERSION -name-template: "v$NEXT_PATCH_VERSION (Code name: Placeholder)" +name-template: 'v$NEXT_PATCH_VERSION (Code name: Placeholder)' tag-template: v$NEXT_PATCH_VERSION diff --git a/test/fixtures/config/config-with-sort-by-title.yml b/test/fixtures/config/config-with-sort-by-title.yml index 5dd44cc40f..a7046a1f31 100644 --- a/test/fixtures/config/config-with-sort-by-title.yml +++ b/test/fixtures/config/config-with-sort-by-title.yml @@ -2,4 +2,4 @@ sort-by: 'title' template: | # What's Changed - $CHANGES \ No newline at end of file + $CHANGES diff --git a/test/fixtures/config/config-with-sort-direction-ascending.yml b/test/fixtures/config/config-with-sort-direction-ascending.yml index f8b9c485b1..fe6487315c 100644 --- a/test/fixtures/config/config-with-sort-direction-ascending.yml +++ b/test/fixtures/config/config-with-sort-direction-ascending.yml @@ -2,4 +2,4 @@ sort-direction: 'ascending' template: | # What's Changed - $CHANGES \ No newline at end of file + $CHANGES diff --git a/test/fixtures/config/config.yml b/test/fixtures/config/config.yml index 457a137ae8..66242cd29b 100644 --- a/test/fixtures/config/config.yml +++ b/test/fixtures/config/config.yml @@ -1,4 +1,4 @@ template: | # What's Changed - $CHANGES \ No newline at end of file + $CHANGES diff --git a/test/fixtures/push-non-master-branch.json b/test/fixtures/push-non-master-branch.json index 01d67d0890..1c8cf268bc 100644 --- a/test/fixtures/push-non-master-branch.json +++ b/test/fixtures/push-non-master-branch.json @@ -25,15 +25,9 @@ "email": "noreply@github.com", "username": "web-flow" }, - "added": [ - - ], - "removed": [ - - ], - "modified": [ - ".github/release-drafter.yml" - ] + "added": [], + "removed": [], + "modified": [".github/release-drafter.yml"] } ], "head_commit": { @@ -53,15 +47,9 @@ "email": "noreply@github.com", "username": "web-flow" }, - "added": [ - - ], - "removed": [ - - ], - "modified": [ - ".github/release-drafter.yml" - ] + "added": [], + "removed": [], + "modified": [".github/release-drafter.yml"] }, "repository": { "id": 133810100, @@ -184,4 +172,4 @@ "installation": { "id": 179208 } -} \ No newline at end of file +} diff --git a/test/fixtures/push.json b/test/fixtures/push.json index 6a94872840..7c774a8d3b 100644 --- a/test/fixtures/push.json +++ b/test/fixtures/push.json @@ -25,15 +25,9 @@ "email": "noreply@github.com", "username": "web-flow" }, - "added": [ - - ], - "removed": [ - - ], - "modified": [ - ".github/release-drafter.yml" - ] + "added": [], + "removed": [], + "modified": [".github/release-drafter.yml"] } ], "head_commit": { @@ -53,15 +47,9 @@ "email": "noreply@github.com", "username": "web-flow" }, - "added": [ - - ], - "removed": [ - - ], - "modified": [ - ".github/release-drafter.yml" - ] + "added": [], + "removed": [], + "modified": [".github/release-drafter.yml"] }, "repository": { "id": 133810100, @@ -184,4 +172,4 @@ "installation": { "id": 179208 } -} \ No newline at end of file +} diff --git a/test/fixtures/release-2.json b/test/fixtures/release-2.json index 629cfe5a3b..eef632b7f9 100644 --- a/test/fixtures/release-2.json +++ b/test/fixtures/release-2.json @@ -36,4 +36,4 @@ "tarball_url": "https://api.github.com/repos/toolmantim/release-drafter-test-project/tarball/v1.0.0", "zipball_url": "https://api.github.com/repos/toolmantim/release-drafter-test-project/zipball/v1.0.0", "body": "An older release" -} \ No newline at end of file +} diff --git a/test/fixtures/release-3.json b/test/fixtures/release-3.json index 285754ac07..5853cfe63a 100644 --- a/test/fixtures/release-3.json +++ b/test/fixtures/release-3.json @@ -36,4 +36,4 @@ "tarball_url": "https://api.github.com/repos/toolmantim/release-drafter-test-project/tarball/v1.5.0", "zipball_url": "https://api.github.com/repos/toolmantim/release-drafter-test-project/zipball/v1.5.0", "body": "An older release" -} \ No newline at end of file +} diff --git a/test/fixtures/release-draft.json b/test/fixtures/release-draft.json index 11ebdbeebc..5929e3ce19 100644 --- a/test/fixtures/release-draft.json +++ b/test/fixtures/release-draft.json @@ -36,4 +36,4 @@ "tarball_url": "https://api.github.com/repos/toolmantim/release-drafter-test-project/tarball/v3.0.0-beta", "zipball_url": "https://api.github.com/repos/toolmantim/release-drafter-test-project/zipball/v3.0.0-beta", "body": "An old release" -} \ No newline at end of file +} diff --git a/test/fixtures/release.json b/test/fixtures/release.json index 1d925bf20b..36857b5240 100644 --- a/test/fixtures/release.json +++ b/test/fixtures/release.json @@ -36,4 +36,4 @@ "tarball_url": "https://api.github.com/repos/toolmantim/release-drafter-test-project/tarball/v2.0.0", "zipball_url": "https://api.github.com/repos/toolmantim/release-drafter-test-project/zipball/v2.0.0", "body": "An old release" -} \ No newline at end of file +}