Skip to content

Commit

Permalink
Merge branch 'release/1.2.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
nwtgck committed May 5, 2021
2 parents c301b10 + c915a74 commit d8d602d
Show file tree
Hide file tree
Showing 8 changed files with 165 additions and 97 deletions.
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)

## [Unreleased]

## [1.2.1] - 2021-05-05
### Added
* Add "fails-without-credentials" input to fail if the credentials not provided [#532](https://github.com/nwtgck/actions-netlify/pull/532)

### Changed
* Update dependencies

## [1.2.0] - 2021-04-29
### Changed
* Update dependencies
Expand All @@ -13,6 +20,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
### Added
* Add "github-deployment-description" input [#513](https://github.com/nwtgck/actions-netlify/pull/513) by [@scopsy](https://github.com/scopsy)

### Fixed
* Make deployment link on pull request if CI is running on pull request [#516](https://github.com/nwtgck/actions-netlify/pull/516) by [@nojvek](https://github.com/nojvek)

## [1.1.13] - 2021-01-28
### Changed
* Update dependencies
Expand Down Expand Up @@ -162,7 +172,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
* Deploy to Netlify
* Comment on GitHub PR

[Unreleased]: https://github.com/nwtgck/actions-netlify/compare/v1.2.0...HEAD
[Unreleased]: https://github.com/nwtgck/actions-netlify/compare/v1.2.1...HEAD
[1.2.1]: https://github.com/nwtgck/actions-netlify/compare/v1.2.0...v1.2.1
[1.2.0]: https://github.com/nwtgck/actions-netlify/compare/v1.1.13...v1.2.0
[1.1.13]: https://github.com/nwtgck/actions-netlify/compare/v1.1.12...v1.1.13
[1.1.12]: https://github.com/nwtgck/actions-netlify/compare/v1.1.11...v1.1.12
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ jobs:
- `alias: deploy-preview-${{ github.event.number }}` replicates the [deploy preview prefix](https://docs.netlify.com/site-deploys/overview/#definitions)
- `github-deployment-environment` Environment name of GitHub Deployments
- `github-deployment-description` Description of the GitHub Deployment
- `fails-without-credentials` Fails if no credentials provided (default: false)

### Paths are relative to the project's root
All paths (eg, `publish-dir`, `netlify-config-path`, `functions-dir`) are relative to the project's root or absolute paths.
Expand Down
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ inputs:
github-deployment-description:
description: Description of the GitHub Deployment
required: false
fails-without-credentials:
description: Fails if no credentials provided
required: false
outputs:
deploy-url:
description: Deploy URL
Expand Down
130 changes: 87 additions & 43 deletions dist/index.js

Large diffs are not rendered by default.

94 changes: 47 additions & 47 deletions package-lock.json

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

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "actions-netlify",
"version": "1.2.0",
"version": "1.2.1",
"private": true,
"description": "GitHub Actions for Netlify",
"main": "lib/main.js",
Expand All @@ -26,13 +26,13 @@
"dependencies": {
"@actions/core": "^1.2.7",
"@actions/github": "^4.0.0",
"netlify": "^6.1.24"
"netlify": "^6.1.26"
},
"devDependencies": {
"@types/jest": "^26.0.23",
"@types/node": "^12.20.10",
"@typescript-eslint/parser": "^4.22.0",
"@vercel/ncc": "^0.28.4",
"@types/node": "^12.20.12",
"@typescript-eslint/parser": "^4.22.1",
"@vercel/ncc": "^0.28.5",
"eslint": "^5.16.0",
"eslint-plugin-github": "^2.0.0",
"eslint-plugin-jest": "^24.3.6",
Expand Down
5 changes: 5 additions & 0 deletions src/inputs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export interface Inputs {
alias(): string | undefined
githubDeploymentEnvironment(): string | undefined
githubDeploymentDescription(): string | undefined
failsWithoutCredentials(): boolean
}

export const defaultInputs: Inputs = {
Expand Down Expand Up @@ -67,5 +68,9 @@ export const defaultInputs: Inputs = {
},
githubDeploymentDescription(): string | undefined {
return core.getInput('github-deployment-description') || undefined
},
failsWithoutCredentials(): boolean {
// Default: false
return core.getInput('fails-without-credentials') === 'true'
}
}
6 changes: 5 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,11 @@ export async function run(inputs: Inputs): Promise<void> {
const siteId = process.env.NETLIFY_SITE_ID
// NOTE: Non-collaborators PRs don't pass GitHub secrets to GitHub Actions.
if (!(netlifyAuthToken && siteId)) {
process.stderr.write('Netlify credentials not provided, not deployable')
const errorMessage = 'Netlify credentials not provided, not deployable'
if (inputs.failsWithoutCredentials()) {
throw new Error(errorMessage)
}
process.stderr.write(errorMessage)
return
}
const dir = inputs.publishDir()
Expand Down

4 comments on commit d8d602d

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.