Skip to content

Commit

Permalink
feat: add option to use the image from ghcr
Browse files Browse the repository at this point in the history
Fixes #12
  • Loading branch information
hussainweb committed Feb 4, 2022
1 parent b1f78c2 commit 972051c
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 3 deletions.
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ inputs:
description: 'Checks to run. This is a YAML formatted structure and must begin with a pipe character.'
required: false
default: ''
registry:
description: 'Select which registry to use. Only DockerHub or GHCR is supported.'
required: false
default: 'ghcr'
outputs: {}
runs:
using: 'node16'
Expand Down
11 changes: 10 additions & 1 deletion 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.

11 changes: 10 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,17 @@ async function main() {
if (!["7.3", "7.4", "8.0", "latest"].includes(phpVersion)) {
throw new Error("Invalid PHP version.");
}

const registry = core.getInput("registry");
if (!["ghcr", "dockerhub"].includes(registry)) {
throw new Error("Invalid registry. Can only be 'ghcr' or 'dockerhub'.");
}

const versionString = phpVersion == "latest" ? "latest" : "php" + phpVersion;
const dockerImage = "hussainweb/drupalqa:" + versionString;
const dockerImage =
(registry == "ghcr" ? "ghcr.io/" : "") +
"hussainweb/drupalqa:" +
versionString;

const webRoot = core.getInput("web-root");

Expand Down

0 comments on commit 972051c

Please sign in to comment.