Skip to content

Commit

Permalink
Tijdelijk de "Delete package or package version" GHA step verwijderd
Browse files Browse the repository at this point in the history
  • Loading branch information
maartenkroon committed Oct 26, 2024
1 parent a14f04a commit c4c4bf1
Showing 1 changed file with 0 additions and 37 deletions.
37 changes: 0 additions & 37 deletions .github/workflows/build-package-development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,43 +47,6 @@ jobs:
- name: Show extracted Maven project groupId, artifactId, version
run: printf '%s\n' "$maven_groupId" "$maven_artifactId" "$maven_version"

- name: Delete package or package version
uses: actions/github-script@v7
id: delete-package-version
with:
script: |
const packageName = process.env.maven_groupId + '.' + process.env.maven_artifactId
const org = context.repo.owner
const versionInfo = await github.rest.packages.getAllPackageVersionsForPackageOwnedByOrg({
package_type: 'maven',
package_name: packageName,
org: org,
})
const versions = versionInfo.data
for (const version of versions) {
if (version.name == process.env.maven_version) {
/* This version is the maven version we want to delete: */
if (versions.length == 1) {
/* This version is the last version of the package so we have to delete the complete package: */
await github.rest.packages.deletePackageForOrg({
package_type: 'maven',
package_name: packageName,
org: context.repo.owner,
});
} else {
/* Remove this version from the package: */
await github.rest.packages.deletePackageVersionForOrg({
package_type: 'maven',
package_name: packageName,
org: context.repo.owner,
package_version_id: version.id,
});
}
break;
}
}
- name: Publish to GitHub Packages Apache Maven
run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml
env:
Expand Down

0 comments on commit c4c4bf1

Please sign in to comment.