Skip to content

Commit 95ad738

Browse files
committed
Merge branch 'dev' into releases/v4
2 parents 8817a56 + face238 commit 95ad738

15 files changed

+291
-404
lines changed

.github/workflows/build.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ jobs:
2727
- name: Install and Test
2828
run: |
2929
yarn install --frozen-lockfile
30-
yarn lint
30+
yarn lint:check
31+
yarn lint:format:check
3132
yarn test
3233
3334
- name: Uploade CodeCov Report

.github/workflows/codeql-analysis.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ jobs:
2222
uses: actions/checkout@v3
2323

2424
- name: Initialize CodeQL
25-
uses: github/codeql-action/init@v1
25+
uses: github/codeql-action/init@v2
2626

2727
- name: Autobuild
28-
uses: github/codeql-action/autobuild@v1
28+
uses: github/codeql-action/autobuild@v2
2929

3030
- name: Perform CodeQL Analysis
31-
uses: github/codeql-action/analyze@v1
31+
uses: github/codeql-action/analyze@v2

.github/workflows/deploy.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
# Workflow dispatch event that pushes the current version to the release branch.
1414
# From here the secondary production deployment workflow will trigger to build the dependencies.
1515
- name: Deploy 🚀
16-
uses: JamesIves/github-pages-deploy-action@v4.3.2
16+
uses: JamesIves/github-pages-deploy-action@v4
1717
with:
1818
branch: releases/v4
1919
folder: .

.github/workflows/integration.yml

+13-25
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,12 @@ jobs:
2828
uses: actions/checkout@v3
2929

3030
- name: Build and Deploy
31-
uses: JamesIves/github-pages-deploy-action@v4.3.2
31+
uses: JamesIves/github-pages-deploy-action@v4
3232
with:
3333
git-config-name: Montezuma
3434
git-config-email: montezuma@jamesiv.es
3535
repository-name: MontezumaIves/lab
3636
token: ${{ secrets.ACCESS_TOKEN }}
37-
branch: gh-pages
3837
folder: integration
3938
single-commit: true
4039
clean: true
@@ -49,10 +48,9 @@ jobs:
4948
uses: actions/checkout@v3
5049

5150
- name: Build and Deploy
52-
uses: JamesIves/github-pages-deploy-action@v4.3.2
51+
uses: JamesIves/github-pages-deploy-action@v4
5352
with:
5453
token: ${{ secrets.ACCESS_TOKEN }}
55-
branch: gh-pages
5654
folder: integration
5755
target-folder: cat/montezuma
5856
git-config-name: Montezuma
@@ -63,7 +61,6 @@ jobs:
6361
uses: dawidd6/action-delete-branch@v3.1.0
6462
with:
6563
github_token: ${{ secrets.GITHUB_TOKEN }}
66-
branches: gh-pages
6764

6865
# Deploys using checkout@v2 with a GITHUB_TOKEN.
6966
integration-checkout-v2:
@@ -76,9 +73,8 @@ jobs:
7673
persist-credentials: false
7774

7875
- name: Build and Deploy
79-
uses: JamesIves/github-pages-deploy-action@v4.3.2
76+
uses: JamesIves/github-pages-deploy-action@v4
8077
with:
81-
branch: gh-pages
8278
folder: integration
8379
target-folder: cat/montezuma2
8480
silent: true
@@ -87,7 +83,6 @@ jobs:
8783
uses: dawidd6/action-delete-branch@v3.1.0
8884
with:
8985
github_token: ${{ secrets.GITHUB_TOKEN }}
90-
branches: gh-pages
9186

9287
# Deploys using a container that requires you to install rsync.
9388
integration-container:
@@ -108,9 +103,8 @@ jobs:
108103
apt-get update && apt-get install -y rsync
109104
110105
- name: Build and Deploy
111-
uses: JamesIves/github-pages-deploy-action@v4.3.2
106+
uses: JamesIves/github-pages-deploy-action@v4
112107
with:
113-
branch: gh-pages
114108
folder: integration
115109
target-folder: cat/montezuma2
116110
silent: true
@@ -132,10 +126,9 @@ jobs:
132126
persist-credentials: false
133127

134128
- name: Build and Deploy
135-
uses: JamesIves/github-pages-deploy-action@v4.3.2
129+
uses: JamesIves/github-pages-deploy-action@v4
136130
with:
137131
ssh-key: ${{ secrets.DEPLOY_KEY }}
138-
branch: gh-pages
139132
folder: integration
140133
target-folder: cat/montezuma3
141134
silent: true
@@ -162,10 +155,9 @@ jobs:
162155
ssh-private-key: ${{ secrets.DEPLOY_KEY }}
163156

164157
- name: Build and Deploy
165-
uses: JamesIves/github-pages-deploy-action@v4.3.2
158+
uses: JamesIves/github-pages-deploy-action@v4
166159
with:
167160
ssh-key: true
168-
branch: gh-pages
169161
folder: integration
170162
target-folder: cat/montezuma4
171163
silent: true
@@ -174,7 +166,6 @@ jobs:
174166
uses: dawidd6/action-delete-branch@v3.1.0
175167
with:
176168
github_token: ${{ secrets.GITHUB_TOKEN }}
177-
branches: gh-pages
178169

179170
# Deploys using a custom env. (Includes subsequent commit)
180171
integration-env:
@@ -191,19 +182,17 @@ jobs:
191182
persist-credentials: false
192183

193184
- name: Build and Deploy
194-
uses: JamesIves/github-pages-deploy-action@v4.3.2
185+
uses: JamesIves/github-pages-deploy-action@v4
195186
with:
196187
ssh-key: ${{ secrets.DEPLOY_KEY }}
197-
branch: gh-pages
198188
folder: integration
199189
target-folder: cat/montezuma4
200190
silent: true
201191

202192
- name: Build and Deploy
203-
uses: JamesIves/github-pages-deploy-action@v4.3.2
193+
uses: JamesIves/github-pages-deploy-action@v4
204194
with:
205195
ssh-key: ${{ secrets.DEPLOY_KEY }}
206-
branch: gh-pages
207196
folder: integration
208197
target-folder: cat/subsequent
209198
silent: true
@@ -233,10 +222,9 @@ jobs:
233222
persist-credentials: false
234223

235224
- name: Build and Deploy
236-
uses: JamesIves/github-pages-deploy-action@v4.3.2
225+
uses: JamesIves/github-pages-deploy-action@v4
237226
with:
238227
token: ${{ secrets.ACCESS_TOKEN }}
239-
branch: gh-pages
240228
folder: integration
241229
clean: true
242230
silent: true
@@ -252,7 +240,7 @@ jobs:
252240
persist-credentials: false
253241

254242
- name: Build and Deploy
255-
uses: JamesIves/github-pages-deploy-action@v4.3.2
243+
uses: JamesIves/github-pages-deploy-action@v4
256244
with:
257245
token: ${{ secrets.ACCESS_TOKEN }}
258246
branch: integration-test-delete-prod
@@ -261,7 +249,7 @@ jobs:
261249
silent: true
262250

263251
- name: Build and Deploy
264-
uses: JamesIves/github-pages-deploy-action@v4.3.2
252+
uses: JamesIves/github-pages-deploy-action@v4
265253
with:
266254
token: ${{ secrets.ACCESS_TOKEN }}
267255
branch: integration-test-delete-prod
@@ -289,7 +277,7 @@ jobs:
289277
run: echo $RANDOM > integration/1
290278

291279
- name: Build and Deploy
292-
uses: JamesIves/github-pages-deploy-action@v4.3.2
280+
uses: JamesIves/github-pages-deploy-action@v4
293281
with:
294282
git-config-name: Montezuma
295283
git-config-email: montezuma@jamesiv.es
@@ -311,7 +299,7 @@ jobs:
311299
run: echo $RANDOM > integration/2
312300

313301
- name: Build and Deploy
314-
uses: JamesIves/github-pages-deploy-action@v4.3.2
302+
uses: JamesIves/github-pages-deploy-action@v4
315303
with:
316304
git-config-name: Montezuma
317305
git-config-email: montezuma@jamesiv.es

.github/workflows/sponsors.yml

+5-3
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,26 @@ jobs:
1212
uses: actions/checkout@v3
1313

1414
- name: Generate Sponsors 💖
15-
uses: JamesIves/github-sponsors-readme-action@v1.0.8
15+
uses: JamesIves/github-sponsors-readme-action@v1
1616
with:
1717
token: ${{ secrets.PAT }}
1818
file: 'README.md'
1919
template: '<a href="https://github.com/{{{ login }}}"><img src="https://github.com/{{{ login }}}.png" width="50px" alt="{{{ login }}}" /></a>&nbsp;&nbsp;'
2020
maximum: 9999
21+
organization: true
2122

2223
- name: Generate Sponsors 💖
23-
uses: JamesIves/github-sponsors-readme-action@v1.0.8
24+
uses: JamesIves/github-sponsors-readme-action@v1
2425
with:
2526
token: ${{ secrets.PAT }}
2627
file: 'README.md'
2728
minimum: 10000
2829
template: '<a href="https://github.com/{{{ login }}}"><img src="https://github.com/{{{ login }}}.png" width="80px" alt="{{{ login }}}" /></a>&nbsp;&nbsp;'
2930
marker: 'premium'
31+
organization: true
3032

3133
- name: Deploy to GitHub Pages
32-
uses: JamesIves/github-pages-deploy-action@v4.3.2
34+
uses: JamesIves/github-pages-deploy-action@v4
3335
with:
3436
branch: dev
3537
folder: '.'

.prettierignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Ignore artifacts:
2+
build
3+
coverage

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ When contributing to this repository, please first discuss the change you wish t
99
2. Ensure your change passes all of the integration tests.
1010
3. Make sure you update the README if you've made a change that requires documentation.
1111
4. When making a pull request, highlight any areas that may cause a breaking change so the maintainer can update the version number accordingly on the GitHub marketplace and package registries.
12-
5. Make sure you've formatted and linted your code. You can do this by running `yarn format` and `yarn lint`.
12+
5. Make sure you've linted and formatted your code. You can do this by running `yarn lint` and `yarn lint:format`.
1313
6. Fix or add any tests where applicable. You can run `yarn test` to run the suite. As this action is small in scope it's important that a high level of test coverage is maintained. All tests are written using [Jest](https://jestjs.io/).
1414
7. As this package is written in [TypeScript](https://www.typescriptlang.org/) please ensure all typing is accurate and the action compiles correctly by running `yarn build`.
1515

README.md

+24-15
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@
4343
</p>
4444

4545
<p align="center">
46-
<!-- premium --><!-- premium -->
46+
<!-- premium --><a href="https://github.com/github"><img src="https://github.com/github.png" width="80px" alt="github" /></a>&nbsp;&nbsp;<!-- premium -->
4747
</p>
4848

4949
<p align="center">
50-
<!-- sponsors --><a href="https://github.com/Chooksta69"><img src="https://github.com/Chooksta69.png" width="50px" alt="Chooksta69" /></a>&nbsp;&nbsp;<a href="https://github.com/milanpollock"><img src="https://github.com/milanpollock.png" width="50px" alt="milanpollock" /></a>&nbsp;&nbsp;<a href="https://github.com/robjtede"><img src="https://github.com/robjtede.png" width="50px" alt="robjtede" /></a>&nbsp;&nbsp;<!-- sponsors -->
50+
<!-- sponsors --><a href="https://github.com/Chooksta69"><img src="https://github.com/Chooksta69.png" width="50px" alt="Chooksta69" /></a>&nbsp;&nbsp;<a href="https://github.com/robjtede"><img src="https://github.com/robjtede.png" width="50px" alt="robjtede" /></a>&nbsp;&nbsp;<a href="https://github.com/hadley"><img src="https://github.com/hadley.png" width="50px" alt="hadley" /></a>&nbsp;&nbsp;<a href="https://github.com/kevinchalet"><img src="https://github.com/kevinchalet.png" width="50px" alt="kevinchalet" /></a>&nbsp;&nbsp;<a href="https://github.com/Yousazoe"><img src="https://github.com/Yousazoe.png" width="50px" alt="Yousazoe" /></a>&nbsp;&nbsp;<!-- sponsors -->
5151
</p>
5252

5353
## Getting Started :airplane:
@@ -59,6 +59,8 @@ You can view an example of this below.
5959
```yml
6060
name: Build and Deploy
6161
on: [push]
62+
permissions:
63+
contents: write
6264
jobs:
6365
build-and-deploy:
6466
concurrency: ci-${{ github.ref }} # Recommended if you intend to make multiple deployments in quick succession.
@@ -73,9 +75,8 @@ jobs:
7375
npm run build
7476
7577
- name: Deploy 🚀
76-
uses: JamesIves/github-pages-deploy-action@v4.3.0
78+
uses: JamesIves/github-pages-deploy-action@v4
7779
with:
78-
branch: gh-pages # The branch the action should deploy to.
7980
folder: build # The folder the action should deploy.
8081
```
8182
@@ -90,6 +91,15 @@ on:
9091

9192
It's recommended that you use [Dependabot](https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically) to keep your workflow up-to-date and [secure](https://github.com/features/security). You can find the latest tagged version on the [GitHub Marketplace](https://github.com/marketplace/actions/deploy-to-github-pages) or on the [releases page](https://github.com/JamesIves/github-pages-deploy-action/releases).
9293

94+
#### Permission Settings ⚠️
95+
96+
If you do not supply the action with an access token or an SSH key, you must access your repositories settings and provide `Read and Write Permissions` to the provided `GITHUB_TOKEN`, otherwise you'll potentailly run into permission issues. Alternatively you can set the following in your workflow file to grant the action the permissions it needs.
97+
98+
```yml
99+
permissions:
100+
contents: write
101+
```
102+
93103
#### Install as a Node Module 📦
94104

95105
If you'd like to use the functionality provided by this action in your own action you can either [create a composite action](https://docs.github.com/en/actions/creating-actions/creating-a-composite-action), or you can install it using [yarn](https://yarnpkg.com/) or [npm](https://www.npmjs.com/get-npm) by running the following commands. It's available on both the [npm](https://www.npmjs.com/package/@jamesives/github-pages-deploy-action) and [GitHub registry](https://github.com/JamesIves/github-pages-deploy-action/packages/229985).
@@ -115,7 +125,6 @@ import run from '@jamesives/github-pages-deploy-action'
115125

116126
run({
117127
token: process.env['ACCESS_TOKEN'],
118-
branch: 'gh-pages',
119128
folder: 'build',
120129
repositoryName: 'JamesIves/github-pages-deploy-action',
121130
silent: true,
@@ -135,7 +144,6 @@ The following options must be configured in order to make a deployment.
135144

136145
| Key | Value Information | Type | Required |
137146
| -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | -------- |
138-
| `branch` | This is the branch you wish to deploy to, for example, `gh-pages` or `docs`. | `with` | **Yes** |
139147
| `folder` | The folder in your repository that you want to deploy. If your build script compiles into a directory named `build` you'd put it here. If you wish to deploy the root directory you can place a `.` here. You can also utilize absolute file paths by appending `~` to your folder path. | `with` | **Yes** |
140148

141149
By default, the action does not need any token configuration and uses the provided repository scoped GitHub token to make the deployment. If you require more customization you can modify the deployment type using the following options.
@@ -149,6 +157,7 @@ By default, the action does not need any token configuration and uses the provid
149157

150158
| Key | Value Information | Type | Required |
151159
| ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | -------- |
160+
| `branch` | This is the branch you wish to deploy to, for example, `gh-pages` or `docs`. Defaults to `gh-pages`. | `with` | **No** |
152161
| `git-config-name` | Allows you to customize the name that is attached to the git config which is used when pushing the deployment commits. If this is not included it will use the name in the GitHub context, followed by the name of the action. | `with` | **No** |
153162
| `git-config-email` | Allows you to customize the email that is attached to the git config which is used when pushing the deployment commits. If this is not included it will use the email in the GitHub context, followed by a generic noreply GitHub email. You can include `<>` for the value if you wish to omit this field altogether and push the commits without an email. | `with` | **No** |
154163
| `repository-name` | Allows you to specify a different repository path so long as you have permissions to push to it. This should be formatted like so: `JamesIves/github-pages-deploy-action`. You'll need to use a PAT in the `token` input for this configuration option to work properly. | `with` | **No** |
@@ -192,9 +201,8 @@ With this configured, you can then set the `ssh-key` part of the action to your
192201

193202
```yml
194203
- name: Deploy 🚀
195-
uses: JamesIves/github-pages-deploy-action@v4.3.0
204+
uses: JamesIves/github-pages-deploy-action@v4
196205
with:
197-
branch: gh-pages
198206
folder: site
199207
ssh-key: ${{ secrets.DEPLOY_KEY }}
200208
```
@@ -222,9 +230,8 @@ jobs:
222230
npm run build
223231
224232
- name: Deploy 🚀
225-
uses: JamesIves/github-pages-deploy-action@v4.3.0
233+
uses: JamesIves/github-pages-deploy-action@v4
226234
with:
227-
branch: gh-pages
228235
folder: build
229236
clean: true
230237
clean-exclude: |
@@ -258,6 +265,8 @@ If you're using an operating system such as [Windows](https://www.microsoft.com/
258265
```yml
259266
name: Build and Deploy
260267
on: [push]
268+
permissions:
269+
contents: write
261270
jobs:
262271
build:
263272
runs-on: windows-latest # The first job utilizes windows-latest
@@ -290,9 +299,8 @@ jobs:
290299
name: site
291300
292301
- name: Deploy 🚀
293-
uses: JamesIves/github-pages-deploy-action@v4.3.0
302+
uses: JamesIves/github-pages-deploy-action@v4
294303
with:
295-
branch: gh-pages
296304
folder: 'site' # The deployment folder should match the name of the artifact. Even though our project builds into the 'build' folder the artifact name of 'site' must be placed here.
297305
```
298306

@@ -311,7 +319,7 @@ If you use a [container](https://help.github.com/en/actions/automating-your-work
311319
apt-get update && apt-get install -y rsync
312320
313321
- name: Deploy 🚀
314-
uses: JamesIves/github-pages-deploy-action@v4.3.0
322+
uses: JamesIves/github-pages-deploy-action@v4
315323
```
316324

317325
---
@@ -325,6 +333,8 @@ If you're using a custom domain and require a `CNAME` file, or if you require th
325333

326334
```yml
327335
name: Build and Deploy
336+
permissions:
337+
contents: write
328338
on:
329339
push:
330340
branches:
@@ -343,9 +353,8 @@ jobs:
343353
npm run build
344354
345355
- name: Deploy 🚀
346-
uses: JamesIves/github-pages-deploy-action@v4.3.0
356+
uses: JamesIves/github-pages-deploy-action@v4
347357
with:
348-
branch: gh-pages
349358
folder: build
350359
clean: true
351360
clean-exclude: |

action.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ inputs:
3333

3434
branch:
3535
description: 'This is the branch you wish to deploy to, for example gh-pages or docs.'
36-
required: true
36+
required: false
37+
default: gh-pages
3738

3839
folder:
3940
description: 'The folder in your repository that you want to deploy. If your build script compiles into a directory named build you would put it here. Folder paths cannot have a leading / or ./. If you wish to deploy the root directory you can place a . here.'

0 commit comments

Comments
 (0)