This commit is contained in:
Edwin Sirko
2024-01-26 16:34:38 +00:00
committed by ddivad195
parent 9853dad78c
commit 120663b080
3 changed files with 11 additions and 13 deletions
+1 -1
View File
@@ -33,7 +33,7 @@ runs:
shell: bash shell: bash
# - run: node ./dist/index.js # - run: node ./dist/index.js
# shell: bash # shell: bash
- uses: ddivad195/publish-action-package/[email protected]3 - uses: ddivad195/publish-action-package/[email protected]4
id: publish id: publish
- name: Output variables - name: Output variables
shell: bash shell: bash
Generated Vendored
+4 -6
View File
@@ -74764,20 +74764,18 @@ async function run() {
} }
// Gather & validate user inputs // Gather & validate user inputs
const token = core.getInput('token'); const token = core.getInput('token');
console.log('Official url: ' + console.log(`Official url: ${process.env.GITHUB_API_URL + '/packages/container-registry-url'}`);
process.env.GITHUB_API_URL +
'/packages/container-registry-url');
//const response = await fetch( //const response = await fetch(
// process.env.GITHUB_API_URL + '/packages/container-registry-url' // process.env.GITHUB_API_URL + '/packages/container-registry-url'
//) //)
const response = await fetch('http://echo.jsontest.com/url/https:--ghcr.io' // for testing locally const response = await fetch('http://echo.jsontest.com/url/https:ghcr.io' // for testing locally. Remove the slashes, they will be reintroduced when forming the URL object below
); );
if (!response.ok) { if (!response.ok) {
throw new Error(`Failed to fetch status page: ${response.statusText}`); throw new Error(`Failed to fetch status page: ${response.statusText}`);
} }
const registryURL = new URL(await (await response.json()).url); const registryURL = new URL(await (await response.json()).url);
console.log(core.getInput('registry')); console.log(`registryURL (supplied): ${core.getInput('registry')}`);
console.log(`registryURL: ${registryURL}`); console.log(`registryURL (from URL): ${registryURL}`);
// Paths to be included in the OCI image // Paths to be included in the OCI image
const paths = core.getInput('path').split(' '); const paths = core.getInput('path').split(' ');
let path = ''; let path = '';
+6 -6
View File
@@ -41,22 +41,22 @@ export async function run(): Promise<void> {
const token: string = core.getInput('token') const token: string = core.getInput('token')
console.log( console.log(
'Official url: ' + `Official url: ${
process.env.GITHUB_API_URL + process.env.GITHUB_API_URL + '/packages/container-registry-url'
'/packages/container-registry-url' }`
) )
//const response = await fetch( //const response = await fetch(
// process.env.GITHUB_API_URL + '/packages/container-registry-url' // process.env.GITHUB_API_URL + '/packages/container-registry-url'
//) //)
const response = await fetch( const response = await fetch(
'http://echo.jsontest.com/url/https:--ghcr.io' // for testing locally 'http://echo.jsontest.com/url/https:ghcr.io' // for testing locally. Remove the slashes, they will be reintroduced when forming the URL object below
) )
if (!response.ok) { if (!response.ok) {
throw new Error(`Failed to fetch status page: ${response.statusText}`) throw new Error(`Failed to fetch status page: ${response.statusText}`)
} }
const registryURL: URL = new URL(await (await response.json()).url) const registryURL: URL = new URL(await (await response.json()).url)
console.log(core.getInput('registry')) console.log(`registryURL (supplied): ${core.getInput('registry')}`)
console.log(`registryURL: ${registryURL}`) console.log(`registryURL (from URL): ${registryURL}`)
// Paths to be included in the OCI image // Paths to be included in the OCI image
const paths: string[] = core.getInput('path').split(' ') const paths: string[] = core.getInput('path').split(' ')