Switch to domain input for GIT_DOMAIN

This commit is contained in:
CrazyMax 2021-03-16 00:04:53 +01:00
parent 85c97ee40b
commit c6b59a0018
No known key found for this signature in database
GPG Key ID: 3248E46B6BB8C7F7
4 changed files with 28 additions and 18 deletions

View File

@ -31,7 +31,8 @@ ___
Below is a simple snippet to deploy to GitHub Pages with a dummy HTML page. Below is a simple snippet to deploy to GitHub Pages with a dummy HTML page.
A [workflow](https://github.com/crazy-max/ghaction-github-pages/actions?query=workflow%3Aci) is also available for this repository and deploys [everyday to GitHub pages](https://crazy-max.github.io/ghaction-github-pages/). A [workflow](https://github.com/crazy-max/ghaction-github-pages/actions?query=workflow%3Aci) is also available for
this repository and deploys [everyday to GitHub pages](https://crazy-max.github.io/ghaction-github-pages/).
```yaml ```yaml
name: website name: website
@ -73,7 +74,8 @@ jobs:
### Sign commits ### Sign commits
You can use the [Import GPG](https://github.com/crazy-max/ghaction-import-gpg) GitHub Action along with this one to sign commits: You can use the [Import GPG](https://github.com/crazy-max/ghaction-import-gpg) GitHub Action along with this one to
sign commits:
```yaml ```yaml
- -
@ -97,7 +99,8 @@ You can use the [Import GPG](https://github.com/crazy-max/ghaction-import-gpg) G
### Check availability of GitHub Pages ### Check availability of GitHub Pages
You can use the [GitHub Status](https://github.com/crazy-max/ghaction-github-status) Action along with this one to check availability of GitHub Pages before deploying: You can use the [GitHub Status](https://github.com/crazy-max/ghaction-github-status) Action along with this one to
check availability of GitHub Pages before deploying:
```yaml ```yaml
- -
@ -123,8 +126,9 @@ You can use the [GitHub Status](https://github.com/crazy-max/ghaction-github-sta
Following inputs can be used as `step.with` keys Following inputs can be used as `step.with` keys
| Name | Type | Description | | Name | Type | Description |
|----------------------|---------|-----------------------------------------------------------------------------| |----------------------|---------|--------------------------------------------------------------------------------|
| `repo` | String | GitHub repository where assets will be deployed (default current) | | `domain` | String | Git domain (default `github.com`) |
| `repo` | String | GitHub repository where assets will be deployed (default `$GITHUB_REPOSITORY`) |
| `target_branch` | String | Git branch where assets will be deployed (default `gh-pages`) | | `target_branch` | String | Git branch where assets will be deployed (default `gh-pages`) |
| `keep_history` | Bool | Create incremental commit instead of doing push force (default `false`) | | `keep_history` | Bool | Create incremental commit instead of doing push force (default `false`) |
| `allow_empty_commit` | Bool | Allow an empty commit to be created (default `true`) | | `allow_empty_commit` | Bool | Allow an empty commit to be created (default `true`) |
@ -143,7 +147,6 @@ Following environment variables can be used as `step.env` keys
|----------------|---------------------------------------| |----------------|---------------------------------------|
| `GITHUB_TOKEN` | [GITHUB_TOKEN](https://help.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token) as provided by `secrets` | | `GITHUB_TOKEN` | [GITHUB_TOKEN](https://help.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token) as provided by `secrets` |
| `GH_PAT` | Use a [Personal Access Token](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/) if you want to deploy to another repo | | `GH_PAT` | Use a [Personal Access Token](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/) if you want to deploy to another repo |
| `GIT_DOMAIN` | Use another domain. Default `github.com` |
## Keep up-to-date with GitHub Dependabot ## Keep up-to-date with GitHub Dependabot
@ -163,7 +166,10 @@ updates:
## How can I help? ## How can I help?
All kinds of contributions are welcome :raised_hands:! The most basic way to show your support is to star :star2: the project, or to raise issues :speech_balloon: You can also support this project by [**becoming a sponsor on GitHub**](https://github.com/sponsors/crazy-max) :clap: or by making a [Paypal donation](https://www.paypal.me/crazyws) to ensure this journey continues indefinitely! :rocket: All kinds of contributions are welcome :raised_hands:! The most basic way to show your support is to star :star2:
the project, or to raise issues :speech_balloon: You can also support this project by
[**becoming a sponsor on GitHub**](https://github.com/sponsors/crazy-max) :clap: or by making a
[Paypal donation](https://www.paypal.me/crazyws) to ensure this journey continues indefinitely! :rocket:
Thanks again for your support, it is much appreciated! :pray: Thanks again for your support, it is much appreciated! :pray:

View File

@ -7,8 +7,12 @@ branding:
icon: 'upload-cloud' icon: 'upload-cloud'
inputs: inputs:
domain:
description: 'Git domain (default github.com)'
required: false
default: 'github.com'
repo: repo:
description: 'GitHub repository where assets will be deployed (default current)' description: 'GitHub repository where assets will be deployed (default $GITHUB_REPOSITORY)'
required: false required: false
target_branch: target_branch:
description: 'Git branch where assets will be deployed' description: 'Git branch where assets will be deployed'

2
dist/index.js generated vendored
View File

@ -252,8 +252,8 @@ const util = __importStar(__webpack_require__(24));
function run() { function run() {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
try { try {
const domain = core.getInput('domain') || 'github.com';
const repo = core.getInput('repo') || process.env['GITHUB_REPOSITORY'] || ''; const repo = core.getInput('repo') || process.env['GITHUB_REPOSITORY'] || '';
const domain = process.env['GIT_DOMAIN'] || 'github.com';
const targetBranch = core.getInput('target_branch') || git.defaults.targetBranch; const targetBranch = core.getInput('target_branch') || git.defaults.targetBranch;
const keepHistory = /true/i.test(core.getInput('keep_history')); const keepHistory = /true/i.test(core.getInput('keep_history'));
const allowEmptyCommit = /true/i.test(core.getInput('allow_empty_commit')); const allowEmptyCommit = /true/i.test(core.getInput('allow_empty_commit'));

View File

@ -8,8 +8,8 @@ import * as util from './util';
async function run() { async function run() {
try { try {
const domain: string = core.getInput('domain') || 'github.com';
const repo: string = core.getInput('repo') || process.env['GITHUB_REPOSITORY'] || ''; const repo: string = core.getInput('repo') || process.env['GITHUB_REPOSITORY'] || '';
const domain: string = process.env['GIT_DOMAIN'] || 'github.com';
const targetBranch: string = core.getInput('target_branch') || git.defaults.targetBranch; const targetBranch: string = core.getInput('target_branch') || git.defaults.targetBranch;
const keepHistory: boolean = /true/i.test(core.getInput('keep_history')); const keepHistory: boolean = /true/i.test(core.getInput('keep_history'));
const allowEmptyCommit: boolean = /true/i.test(core.getInput('allow_empty_commit')); const allowEmptyCommit: boolean = /true/i.test(core.getInput('allow_empty_commit'));