Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
aaa3e01
remove duplicate CODEOWNERS file
GrantBirki Apr 13, 2023
7977313
add new root level files
GrantBirki Apr 13, 2023
ff86b6c
update version in package file
GrantBirki Apr 13, 2023
215f5a3
update all workflow files to use the .node-version file in the root o…
GrantBirki Apr 13, 2023
1743657
init the coverage badge
GrantBirki Apr 13, 2023
f1d846d
move test file
GrantBirki Apr 13, 2023
ddc80ba
add a CONTRIBUTING file
GrantBirki Apr 13, 2023
f5eb43c
update readme
GrantBirki Apr 13, 2023
f28358b
update ci-test and jest
GrantBirki Apr 13, 2023
c21c0b1
enforce 100% test coverage
GrantBirki Apr 13, 2023
68c51d2
write coverage badge
GrantBirki Apr 13, 2023
adb13af
add coverage badge to readme
GrantBirki Apr 13, 2023
54f2959
npm update all the things
GrantBirki Apr 13, 2023
b98f9c9
add inputs and outputs to the readme
GrantBirki Apr 13, 2023
f0789de
structure readme
GrantBirki Apr 13, 2023
dbac87a
new lines
GrantBirki Apr 13, 2023
515e39e
structuring tests and functions
GrantBirki Apr 14, 2023
3194543
update tests
GrantBirki Apr 14, 2023
5f3aba0
reduce passing coverage while writing tests
GrantBirki Apr 14, 2023
7b5216c
bundle and fmt
GrantBirki Apr 14, 2023
44c5eaa
add check when no deployment is found
GrantBirki Apr 14, 2023
c38b369
exits early when deployment is not in progress - test
GrantBirki Apr 14, 2023
36f9337
test early exit on a deployment cancel request
GrantBirki Apr 14, 2023
571bf8a
catches an error when trying to cancel a deployment - test
GrantBirki Apr 14, 2023
c05cd8b
at least 70% coverage
GrantBirki Apr 14, 2023
c667db8
bundle
GrantBirki Apr 14, 2023
9c5eb69
remove required test coverage section
GrantBirki Apr 14, 2023
425b204
Use node-version-file parameter instead of an extra step
JamesMGreene Apr 14, 2023
f7c37e7
Remove .eslintignore file in favor of existing .eslintrc.json ignore …
JamesMGreene Apr 18, 2023
20bd69d
Remove 'ci-test' script in favor of generating coverage badges as par…
JamesMGreene Apr 18, 2023
a8b1dc4
Actions naming cleanup/reverts
JamesMGreene Apr 18, 2023
dab0b0f
Remove unnecessary checkout from release drafting workflow
JamesMGreene Apr 18, 2023
5daf428
Tidy up comment so Dependabot can update it
JamesMGreene Apr 18, 2023
324f764
Unpin actions usage since we trust our own org
JamesMGreene Apr 18, 2023
3a8a04e
Pin release-drafter action usage since we cannot trust outside orgs
JamesMGreene Apr 18, 2023
5aacbea
Update README with info on Environment Variables set
JamesMGreene Apr 18, 2023
0d1bd15
Minor wording update in README
JamesMGreene Apr 18, 2023
e93f066
Use real version tag in example usage
JamesMGreene Apr 18, 2023
16c932f
Update contribution instructions
JamesMGreene Apr 18, 2023
26c37d6
Wording tweak
JamesMGreene Apr 18, 2023
b463fdb
Shorten workflow names for better badges
JamesMGreene Apr 18, 2023
ddf1436
Reorder badges
JamesMGreene Apr 18, 2023
0a6b5a0
Add badge for latest release
JamesMGreene Apr 18, 2023
c77de14
Use shields.io for more consistent badges
JamesMGreene Apr 18, 2023
efce276
Revert Actions workflow names since we're overriding in badges
JamesMGreene Apr 18, 2023
6657d34
Rename 'functions' directory to 'internal'
JamesMGreene Apr 18, 2023
31bb456
Move coverage badge to root directory
JamesMGreene Apr 18, 2023
b8a0d02
Alphabetize the npm scripts
JamesMGreene Apr 18, 2023
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
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
"rules": {
"semi": ["error", "never"]
},
"ignorePatterns": ["/dist/", "/pre/"]
"ignorePatterns": ["/dist/"]
}
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist/** -diff linguist-generated=true
15 changes: 12 additions & 3 deletions .github/workflows/check-dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v3

- name: Set Node.js 16.x
- name: Setup Node.JS
uses: actions/setup-node@v3
with:
node-version: 16.x
node-version-file: '.node-version'
cache: npm

- name: Install dependencies
Expand All @@ -36,9 +37,17 @@ jobs:
run: npm run prepare

- name: Compare the expected and actual dist/ directories
id: diff
run: |
if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then
echo "Detected uncommitted changes after build in dist folder. See status below:"
git diff
exit 1
fi

# If index.js was different than expected, upload the expected version as an artifact
- uses: actions/upload-artifact@v3
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
with:
name: dist
path: dist/
6 changes: 3 additions & 3 deletions .github/workflows/check-formatting.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Checking formatting
name: Check formatting

on:
push:
Expand All @@ -24,8 +24,8 @@ jobs:
- name: Setup Node.JS
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: 'npm'
node-version-file: '.node-version'
cache: npm

- name: Install dependencies
run: npm ci
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/check-linter.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Check linter
name: Check linting

on:
push:
Expand All @@ -24,8 +24,8 @@ jobs:
- name: Setup Node.JS
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: 'npm'
node-version-file: '.node-version'
cache: npm

- name: Install dependencies
run: npm ci
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: 'CodeQL'
name: CodeQL

on:
push:
Expand Down Expand Up @@ -37,7 +37,7 @@ jobs:
# Learn more about CodeQL language support at https://git.io/codeql-language-support

steps:
- name: Checkout repository
- name: Checkout
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/draft-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ jobs:
draft-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: release-drafter/release-drafter@v5
- uses: release-drafter/release-drafter@569eb7ee3a85817ab916c8f8ff03a5bd96c9c83e # v5.23.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/rebuild-dependabot-prs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ jobs:
- name: Setup Node.JS
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: 'npm'
node-version-file: '.node-version'
cache: npm

- name: Install dependencies
run: npm ci
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run Tests
name: Run tests

on:
push:
Expand All @@ -19,8 +19,8 @@ jobs:
- name: Setup Node.JS
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: 'npm'
node-version-file: '.node-version'
cache: npm

- name: Install dependencies
run: npm ci
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ typings/
.env

# next.js build output
.next
.next
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18.9.0
1 change: 0 additions & 1 deletion CODEOWNERS

This file was deleted.

29 changes: 29 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Contributing 💻

All contributions are welcome and greatly appreciated!

## Steps to Contribute 💡

> Check the `.node-version` file in the root of this repo so see what version of Node.js is required for local development - note, this can be different from the version of Node.js which runs the Action on GitHub runners. It is suggested to download [nodenv](https://github.com/nodenv/nodenv) which uses this file and manages your Node.js versions for you

1. Fork this repository
2. Make your changes
3. [Test](#testing-) your changes locally
4. Before opening a pull request, please run `npm run all` to verify formatting, linting, tests, generated files, etc.
5. Commit and push your changes to your fork
6. Open a pull request back to this repository
7. Wait for an approval or changes requested from the maintainers of this repository

After merging the pull request, the maintainers of this repository will create a new release with those changes included. After that, everyone can utilize the newly integrated changes in their own Actions workflows and enjoy your awesome improvements!

## Testing 🧪

### Running the test suite (required)

Simply run the following command to execute the entire test suite:

```bash
npm test
```

> Note: This requires that you have already run `npm install`.
45 changes: 36 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# deploy-pages
# deploy-pages 🚀

This action is used to deploy [Actions artifacts][artifacts] to GitHub Pages.
[![Release](https://img.shields.io/github/v/release/actions/deploy-pages?label=Release&logo=github)](https://github.com/actions/deploy-pages/releases/latest) [![Linting](https://img.shields.io/github/actions/workflow/status/actions/deploy-pages/check-linter.yml?label=Linting&logo=github)](https://github.com/actions/deploy-pages/actions/workflows/check-linter.yml) [![Formatting](https://img.shields.io/github/actions/workflow/status/actions/deploy-pages/check-formatting.yml?label=Formatting&logo=github)](https://github.com/actions/deploy-pages/actions/workflows/check-formatting.yml) [![Tests](https://img.shields.io/github/actions/workflow/status/actions/deploy-pages/test.yml?label=Tests&logo=github)](https://github.com/actions/deploy-pages/actions/workflows/test.yml) ![Coverage](./coverage_badge.svg) [![Distributables](https://img.shields.io/github/actions/workflow/status/actions/deploy-pages/check-dist.yml?label=Distributables&logo=github)](https://github.com/actions/deploy-pages/actions/workflows/check-dist.yml) [![CodeQL](https://img.shields.io/github/actions/workflow/status/actions/deploy-pages/codeql-analysis.yml?label=CodeQL&logo=github)](https://github.com/actions/deploy-pages/actions/workflows/codeql-analysis.yml)

## Scope

⚠️ Official support for building Pages with Actions is in public beta at the moment.
This action is used to deploy [Actions artifacts][artifacts] to [GitHub Pages](https://pages.github.com/).

## Usage

Expand Down Expand Up @@ -43,10 +41,39 @@ jobs:
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
uses: actions/deploy-pages@v2 # or the latest "vX.X.X" version tag for this action
```

## Security considerations
### Inputs 📥

| Input | Required? | Default | Description |
| ----- | --------- | ------- | ----------- |
| `token` | `true` | `${{ github.token }}` | The GitHub token used to create an authenticated client - Provided for you by default! |
| `emit_telemetry` | `false` | `"false"` | Should this action only emit build telemetry instead of deploying the build artifact? |
| `conclusion` | `false` | - | The status of the previous build |
| `timeout` | `false` | `"600000"` | Time in milliseconds after which to timeout and cancel the deployment (default: 10 minutes) |
| `error_count` | `false` | `"10"` | Maximum number of status report errors before cancelling a deployment (default: 10) |
| `reporting_interval` | `false` | `"5000"` | Time in milliseconds between two deployment status report (default: 5 seconds) |
| `artifact_name` | `false` | `"github-pages"` | The name of the artifact to deploy |
| `preview` | `false` | `"false"` | Is this attempting to deploy a pull request as a GitHub Pages preview site? (NOTE: This feature is only in alpha currently and is not available to the public!) |

### Outputs 📤

| Output | Description |
| ------ | ----------- |
| `page_url` | The URL of the deployed Pages site |

### Environment Variables 🌎

| Variable | Description |
| -------- | ----------- |
| `GITHUB_PAGES` | This environment variable is created and set to the string value `"true"` so that framework build tools may choose to differentiate their output based on the intended target hosting platform. |

## Scope

⚠️ Official support for building Pages with Actions is in public beta at the moment.

## Security Considerations

There are a few important considerations to be aware of:

Expand All @@ -60,9 +87,9 @@ There are a few important considerations to be aware of:

4. If your Pages site is using a source branch, the deployment must originate from this source branch unless [your environment is protected][environment-protection] in which case the environment protection rules take precedence over the source branch rule

5. If your Pages site is using GitHub Actions as the source, while not required we highly recommend you also [protect your environment][environment-protection] (we do it by default for you)
5. If your Pages site is using GitHub Actions as the source, while not required we highly recommend you also [protect your environment][environment-protection] (we will configure it by default for you).

# Release instructions
## Release Instructions

In order to release a new version of this Action:

Expand Down
1 change: 1 addition & 0 deletions coverage_badge.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 12 additions & 10 deletions dist/index.js

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

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

Loading