Skip to content

Commit

Permalink
Updated git files, dependencies and recompiled
Browse files Browse the repository at this point in the history
  • Loading branch information
mxmauro committed Oct 25, 2022
1 parent 0491fc8 commit 4e31424
Show file tree
Hide file tree
Showing 7 changed files with 109 additions and 194 deletions.
2 changes: 0 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,3 @@
*.ez binary
*.bz2 binary
*.swp binary

dist/** -diff linguist-generated=true
102 changes: 2 additions & 100 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,102 +1,4 @@
*.~*
/.vscode

# Dependency directory
node_modules

# Rest pulled from https://github.com/github/gitignore/blob/master/Node.gitignore
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
jspm_packages/

# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# next.js build output
.next

# nuxt.js build output
.nuxt

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# OS metadata
.DS_Store
Thumbs.db

# Ignore built ts files
__tests__/runner/*
lib/**/*
/node_modules
/lib
39 changes: 23 additions & 16 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,27 +193,27 @@ function run() {
throw new Error(msg);
}
// Delete any existing image with the same tag
core.info('Deleting existing tagged container package if exists');
core.info('Checking for existing tagged container package');
let packageId = 0;
for (let page = 0; packageId == 0 && page < 20; page += 1) {
for (let page = 1; packageId == 0 && page <= 20; page += 1) {
try {
const packagesInfo = yield octokit.rest.packages.getAllPackageVersionsForPackageOwnedByOrg({
package_type: 'container',
package_name: repo,
org: owner,
state: 'active',
page,
per_page: 100
per_page: 100,
state: 'active'
});
if (packagesInfo.status !== 200) {
throw new Error('Failed to retrieve the list of images');
}
for (const pkg of packagesInfo.data) {
if (pkg.metadata && pkg.metadata.container) {
if (pkg.metadata && pkg.metadata.container && pkg.metadata.container.tags) {
for (const tag of pkg.metadata.container.tags) {
if (tag == tagName) {
// found!
core.info('-> found existing');
core.info('-> Found. Deleting...');
packageId = pkg.id;
break;
}
Expand All @@ -236,17 +236,24 @@ function run() {
}
}
if (packageId > 0) {
const deleteInfo = yield octokit.rest.packages.deletePackageForOrg({
package_type: 'container',
package_name: repo,
org: owner,
id: packageId
});
// Check status to ensure the package was deleted
if (deleteInfo.status !== 204 && deleteInfo.status !== 404) {
throw new Error('Failed to delete existing package');
try {
const deleteInfo = yield octokit.rest.packages.deletePackageForOrg({
package_type: 'container',
package_name: repo,
org: owner,
id: packageId
});
// Check status to ensure the package was deleted
if (deleteInfo.status !== 204) {
throw new Error('Failed to delete existing package');
}
}
catch (err) {
// Handle release not found error
if (err.status !== 404 && err.message !== 'Not Found') {
throw err;
}
}
// 204, 404
}
// Prepare to push image
core.info('Pushing image');
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

112 changes: 56 additions & 56 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 4e31424

Please sign in to comment.