Skip to content

Commit

Permalink
fix: add info log, use node20, node test runner and assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrickHeneise committed Dec 22, 2023
1 parent f5a8ce5 commit 9227e51
Show file tree
Hide file tree
Showing 23 changed files with 27,978 additions and 24,044 deletions.
8 changes: 2 additions & 6 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,13 @@
"es2021": true,
"node": true
},
"globals": {
"jest": true
},
"extends": [
"eslint:recommended",
"plugin:node/recommended",
"plugin:json/recommended",
"plugin:jest/recommended"
"plugin:json/recommended"
],
"parserOptions": {
"ecmaVersion": 12,
"ecmaVersion": "latest",
"sourceType": "module"
}
}
1 change: 0 additions & 1 deletion .gitattributes

This file was deleted.

3 changes: 2 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"singleQuote": true,
"semi": false,
"trailingComma": "none"
"trailingComma": "none",
"proseWrap": "always"
}
10 changes: 7 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
# How to contribute

We'd love to accept your patches and contributions to this project. There are just a few small guidelines you need to follow.
We'd love to accept your patches and contributions to this project. There are
just a few small guidelines you need to follow.

## Code reviews

All submissions require review. We use GitHub pull requests for this purpose. Consult [GitHub Help](https://help.github.com/articles/about-pull-requests/) for more information on using pull requests.
All submissions require review. We use GitHub pull requests for this purpose.
Consult [GitHub Help](https://help.github.com/articles/about-pull-requests/) for
more information on using pull requests.

## Style Guide

This project provides a prettier configuration. All submitted PRs will be required to conform to this style guide before being merged.
This project provides a prettier configuration. All submitted PRs will be
required to conform to this style guide before being merged.
22 changes: 16 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
[![semantic-release: conventional](https://img.shields.io/badge/semantic--release-conventional-e10079?logo=semantic-release)](https://github.com/semantic-release/semantic-release)
[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org)

Retrieve the preview URL from the Cloudflare API, filtered by the repository and branch. The URL can then be used for further end-to-end tests, link checks and other PR integrations/actions.
Retrieve the preview URL from the Cloudflare API, filtered by the repository and
branch. The URL can then be used for further end-to-end tests, link checks and
other PR integrations/actions.

## Table of Contents

Expand All @@ -18,7 +20,10 @@ Retrieve the preview URL from the Cloudflare API, filtered by the repository and

[Copy your "Global API Key"](https://dash.cloudflare.com/profile/api-tokens)

Cloudflare needs a little time to build the preview, you can check the average build time in your deployments and add the seconds plus a little to a `sleep` action, to wait until the deployment is ready. The action only works on branches, so make sure you exclude the `main` branch from the trigger:
Cloudflare needs a little time to build the preview, you can check the average
build time in your deployments and add the seconds plus a little to a `sleep`
action, to wait until the deployment is ready. The action only works on
branches, so make sure you exclude the `main` branch from the trigger:

```yaml
on:
Expand All @@ -33,7 +38,7 @@ Here are the steps for an example job:
```yaml
- run: sleep 30
- name: cloudflare-preview-url
uses: zentered/cloudflare-preview-url@v1.0.0
uses: zentered/cloudflare-preview-url@v1
id: cloudflare_preview_url
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
Expand All @@ -46,7 +51,8 @@ Here are the steps for an example job:
run: echo "https://${{ steps.cloudflare_preview_url.outputs.preview_url }}"
```
We recommend to set a timeout for this action, if something goes wrong with the build, the Action should stop after 10 minutes:
We recommend setting a timeout for this action, if something goes wrong with the
build, the Action should stop after 10 minutes:
```yaml
runs-on: ubuntu-latest
Expand All @@ -55,10 +61,14 @@ timeout-minutes: 10
## Environment Variables / Secret
In the repository, go to "Settings", then "Secrets" and add "CLOUDFLARE_API_TOKEN", the value you can retrieve on your [Cloudflare account](https://dash.cloudflare.com/profile/api-tokens). You also need to add:
In the repository, go to "Settings", then "Secrets" and add
"CLOUDFLARE_API_TOKEN", the value you can retrieve on your
[Cloudflare account](https://dash.cloudflare.com/profile/api-tokens). You also
need to add:
- `CLOUDFLARE_ACCOUNT_EMAIL` (your login email, optional)
- `CLOUDFLARE_ACCOUNT_ID` (from the URL: `https://dash.cloudflare.com/123abc....`)
- `CLOUDFLARE_ACCOUNT_ID` (from the URL:
`https://dash.cloudflare.com/123abc....`)

## Inputs

Expand Down
4 changes: 2 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ inputs:
wait_until_ready:
description: 'Wait for deployment to be ready'
required: false
default: false
default: ''
environment:
description: "Which Cloudflare deployment environments to allow. If set to null, doesn't filter deploys by environment. Defaults to 'preview'"
required: false
Expand All @@ -26,4 +26,4 @@ outputs:
description: "A string with the unique URL of the deployment. If it hasn't finished uploading (is incomplete), the value will be null."
runs:
main: dist/index.js
using: node16
using: node20
12 changes: 0 additions & 12 deletions babel.config.json

This file was deleted.

Loading

0 comments on commit 9227e51

Please sign in to comment.