-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
45ba7fb
commit 7a82880
Showing
15 changed files
with
63,918 additions
and
287 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,55 @@ | ||
name: "CI" | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
schedule: | ||
- cron: '22 12 * * 0' | ||
branches: | ||
- '**' | ||
|
||
concurrency: | ||
group: ${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
analyze: | ||
name: Analyze | ||
checks: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
language: [ 'javascript' ] | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v3 | ||
with: | ||
languages: ${{ matrix.language }} | ||
queries: security-extended | ||
- name: Autobuild | ||
uses: github/codeql-action/autobuild@v3 | ||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v3 | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: "20" | ||
|
||
- name: Install | ||
run: yarn | ||
|
||
- name: Lint | ||
run: yarn run lint:check | ||
|
||
- name: Prettier | ||
run: yarn run prettier:check | ||
|
||
test: | ||
name: Test | ||
runs-on: ubuntu-latest | ||
permissions: | ||
actions: read | ||
contents: read | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: "20" | ||
- name: Install | ||
run: yarn install --frozen-lockfile | ||
- name: Lint | ||
run: yarn run lint:check | ||
- name: Prettier | ||
run: yarn run prettier:check | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: "20" | ||
|
||
- name: Install | ||
run: yarn | ||
|
||
- name: Test Action | ||
uses: ./ | ||
with: | ||
countryCodes: | | ||
US | ||
HK | ||
SG | ||
DE | ||
target: venus.io |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
yarn run prettier:check | ||
yarn run lint:check | ||
yarn run build | ||
# Build action | ||
yarn run build | ||
|
||
# Add build files to commit | ||
git add . dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
v20.11.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"trailingComma": "all", | ||
"tabWidth": 2, | ||
"semi": true, | ||
"singleQuote": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,5 @@ | ||
# GitHub Actions Boilerplate | ||
# Venus Globalping Github Action | ||
|
||
## Introduction | ||
|
||
A sample GitHub action boilerplate for Typescript actions. | ||
|
||
It comes with: | ||
|
||
- **Node 16 Support**: Current LTS. | ||
- **ESlint and Prettier**: Code quality and consistency tooling. | ||
- **Husky**: Pre-commit hook ensuring code is built before being deployed to GitHub. | ||
|
||
There are many open source actions boilerplates/templates. I use this one as I try and keep it up to date and simplistic. | ||
|
||
## Getting Started | ||
|
||
Click [Use this template](https://github.com/NickLiffen/actions-boilerplate/generate) on this repository. Enter in your action repository name and description, and click *Create repository from template*. | ||
|
||
Close down locally, and run: | ||
|
||
```sh | ||
yarn install --frozen-lockfile && yarn run build | ||
``` | ||
|
||
Edit the required fields within the `package.json` and `action.yml` and you should be good to go. Simply start writing code within the `src` directory. | ||
|
||
## Testing Locally | ||
|
||
We use [act](https://github.com/nektos/act) to test our actions locally. If you are interested in testing your action locally, you will need to do a few things: | ||
|
||
1. Create a `my.secrets` file. This file will contain all the secrets required in your workflow to test this action. | ||
2. Create a `.env.` within the root of this repository. This file will contain any environment variables required in your workflow to test this action. | ||
3. Update the `.github/workflows/regression.yml` file to test your action. This will include updating any `events` in the workflow and inputs. | ||
4. Update the `.github/workflows/regression/payload.yml` file, which contains the input payload for your action. | ||
|
||
Once you have done the above, you are ready to test locally and run `yarn run local`. This will trigger `act` to run your workflow and, therefore, your action. | ||
|
||
For more information on how to use act, see the instructions here: [Act Overview](https://github.com/nektos/act/blob/master/README.md). | ||
|
||
## Contributing? | ||
|
||
Simply raise a pull request :) Make sure CI passes and then you should be good to go. | ||
|
||
A GitHub Action to ping a website from multiple locations using [Globalping](https://globalping.io). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,14 @@ | ||
name: 'Action Name' | ||
author: 'NickLiffen' | ||
description: 'Action Description' | ||
name: 'Venus Globalping GitHub Action' | ||
author: 'Venus Protocol' | ||
description: 'A GitHub Action to ping a website from multiple locations using Globalping' | ||
inputs: | ||
inputName: | ||
description: 'Input Description' | ||
target: | ||
description: 'Target (hostname, IPv4 or IPv6 address)' | ||
required: true | ||
countryCodes: | ||
multiline: true | ||
description: 'List of countries (based on ISO 3166-1 alpha-2 country codes) to ping the website from' | ||
required: true | ||
outputs: | ||
outputName: | ||
description: 'Output Description' | ||
runs: | ||
using: 'node20' | ||
main: 'dist/index.js' | ||
branding: | ||
icon: 'target' | ||
color: 'blue' |
Oops, something went wrong.