Skip to content
This repository was archived by the owner on Mar 4, 2021. It is now read-only.

Prettier 2.0.4 #60

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ name: "Tests"
on:
pull_request:
push:
branches: # array of glob patterns matching against refs/heads. Optional; defaults to all
- master # triggers on pushes that contain changes in master
branches: # array of glob patterns matching against refs/heads. Optional; defaults to all
- master # triggers on pushes that contain changes in master

jobs:
test:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/versioning.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ jobs:
with:
publish_latest: true
env:
GITHUB_TOKEN: '${{secrets.GITHUB_TOKEN}}'
GITHUB_TOKEN: "${{secrets.GITHUB_TOKEN}}"
30 changes: 15 additions & 15 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
name: 'Create a Release'
description: 'Create a release for a tag in your repository'
author: 'GitHub'
name: "Create a Release"
description: "Create a release for a tag in your repository"
author: "GitHub"
inputs:
tag_name:
description: 'The name of the tag. This should come from the webhook payload, `github.GITHUB_REF` when a user pushes a new tag'
description: "The name of the tag. This should come from the webhook payload, `github.GITHUB_REF` when a user pushes a new tag"
required: true
release_name:
description: 'The name of the release. For example, `Release v1.0.1`'
description: "The name of the release. For example, `Release v1.0.1`"
required: true
body:
description: 'Text describing the contents of the tag.'
description: "Text describing the contents of the tag."
required: false
draft:
description: '`true` to create a draft (unpublished) release, `false` to create a published one. Default: `false`'
description: "`true` to create a draft (unpublished) release, `false` to create a published one. Default: `false`"
required: false
default: false
prerelease:
description: '`true` to identify the release as a prerelease. `false` to identify the release as a full release. Default: `false`'
description: "`true` to identify the release as a prerelease. `false` to identify the release as a full release. Default: `false`"
required: false
default: false
outputs:
id:
description: 'The ID of the created Release'
description: "The ID of the created Release"
html_url:
description: 'The URL users can navigate to in order to view the release'
description: "The URL users can navigate to in order to view the release"
upload_url:
description: 'The URL for uploading assets to the release'
description: "The URL for uploading assets to the release"
runs:
using: 'node12'
main: 'dist/index.js'
using: "node12"
main: "dist/index.js"
branding:
icon: 'tag'
color: 'gray-dark'
icon: "tag"
color: "gray-dark"
29 changes: 16 additions & 13 deletions dist/index.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
"main": "dist/index.js",
"scripts": {
"lint": "eslint 'src/**.js' 'tests/**.js' --fix",
"format": "prettier --write **/*.{js,json,yml}",
"format-check": "prettier --check **/*.{js,json,yml}",
"test": "eslint 'src/**.js' 'tests/**.js' && jest --coverage",
"build": "ncc build src/main.js",
"precommit": "npm run build && git add dist/"
Expand Down Expand Up @@ -34,7 +36,7 @@
"eslint-plugin-prettier": "^2.7.0",
"eslint-plugin-react": "^7.12.4",
"jest": "^24.8.0",
"prettier": "^1.16.4",
"prettier": "2.0.4",
"husky": "^3.0.5"
},
"jest": {
Expand Down
29 changes: 16 additions & 13 deletions src/create-release.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const core = require('@actions/core');
const { GitHub, context } = require('@actions/github');
const core = require("@actions/core");
const { GitHub, context } = require("@actions/github");

async function run() {
try {
Expand All @@ -10,14 +10,17 @@ async function run() {
const { owner, repo } = context.repo;

// Get the inputs from the workflow file: https://github.com/actions/toolkit/tree/master/packages/core#inputsoutputs
const tagName = core.getInput('tag_name', { required: true });
const tagName = core.getInput("tag_name", { required: true });

// This removes the 'refs/tags' portion of the string, i.e. from 'refs/tags/v1.10.15' to 'v1.10.15'
const tag = tagName.replace('refs/tags/', '');
const releaseName = core.getInput('release_name', { required: true }).replace('refs/tags/', '');
const body = core.getInput('body', { required: false });
const draft = core.getInput('draft', { required: false }) === 'true';
const prerelease = core.getInput('prerelease', { required: false }) === 'true';
const tag = tagName.replace("refs/tags/", "");
const releaseName = core
.getInput("release_name", { required: true })
.replace("refs/tags/", "");
const body = core.getInput("body", { required: false });
const draft = core.getInput("draft", { required: false }) === "true";
const prerelease =
core.getInput("prerelease", { required: false }) === "true";

// Create a release
// API Documentation: https://developer.github.com/v3/repos/releases/#create-a-release
Expand All @@ -29,18 +32,18 @@ async function run() {
name: releaseName,
body,
draft,
prerelease
prerelease,
});

// Get the ID, html_url, and upload URL for the created Release from the response
const {
data: { id: releaseId, html_url: htmlUrl, upload_url: uploadUrl }
data: { id: releaseId, html_url: htmlUrl, upload_url: uploadUrl },
} = createReleaseResponse;

// Set the output variables for use by other actions: https://github.com/actions/toolkit/tree/master/packages/core#inputsoutputs
core.setOutput('id', releaseId);
core.setOutput('html_url', htmlUrl);
core.setOutput('upload_url', uploadUrl);
core.setOutput("id", releaseId);
core.setOutput("html_url", htmlUrl);
core.setOutput("upload_url", uploadUrl);
} catch (error) {
core.setFailed(error.message);
}
Expand Down
2 changes: 1 addition & 1 deletion src/main.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const run = require('./create-release');
const run = require("./create-release");

if (require.main === module) {
run();
Expand Down
Loading