From c632014a565752bc8d698299bd8f22ded3f33bdf Mon Sep 17 00:00:00 2001 From: Trent Jones Date: Sat, 29 Feb 2020 18:09:40 -0600 Subject: [PATCH] doc update --- README.md | 46 +++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 43 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c318d0b..b3b4ab9 100644 --- a/README.md +++ b/README.md @@ -53,11 +53,14 @@ This action deletes versions of a package from [GitHub Packages](https://github. * [Delete a specific version from a package hosted in a different repo than the workflow](#delete-a-specific-version-from-a-package-hosted-in-a-different-repo-than-the-workflow) * [Delete multiple specific versions from a package hosted in the same repo as the workflow](#delete-multiple-specific-versions-from-a-package-hosted-in-the-same-repo-as-the-workflow) * [Delete multiple specific versions from a package hosted in a different repo than the workflow](#delete-multiple-specific-versions-from-a-package-hosted-in-a-different-repo-than-the-workflow) +* [Delete oldest version from a package hosted in the same repo as the workflow](#delete-oldest-version-from-a-package-hosted-in-the-same-repo-as-the-workflow) ### Delete a specific version from a package hosted in the same repo as the workflow +To delete a specific version from a package that is hosted in the same repo that is executing the workflow the __package-version-ids__ input is required. + Package version ids can be retrieved via the [GitHub GraphQL API][api]. ```yaml @@ -70,7 +73,11 @@ Package version ids can be retrieved via the [GitHub GraphQL API][api]. ### Delete a specific version from a package hosted in a different repo than the workflow -Package version ids can be retrieved via the [GitHub GraphQL API][api]. The token input is required to delete a version of a package hosted in a different repo than the workflow. The [token][token] only needs the delete packages scope. It is recommended [to store the token as a secret][secret]. In this example the [token][token] was stored as a secret named __GITHUB_PAT__. +To delete a specific version from a package that is hosted in a different repo than the one executing the workflow the __package-version-ids__, and __token__ inputs are required. + +Package version ids can be retrieved via the [GitHub GraphQL API][api]. + +The [token][token] only needs the delete packages scope. It is recommended [to store the token as a secret][secret]. In this example the [token][token] was stored as a secret named __GITHUB_PAT__. ```yaml - uses: actions/delete-package-versions@v1 @@ -83,7 +90,9 @@ Package version ids can be retrieved via the [GitHub GraphQL API][api]. The toke ### Delete multiple specific versions from a package hosted in the same repo as the workflow -To delete multiple specifc versions of a package set __package-version-ids__ to a comma separated string of package version ids. Package version ids can be retrieved via the [GitHub GraphQL API][api]. +To delete multiple specifc versions from a package that is hosted in the same repo that is executing the workflow the __package-version-ids__ input is required. + +The __package-version-ids__ input should be a comma separated string of package version ids. Package version ids can be retrieved via the [GitHub GraphQL API][api]. ```yaml - uses: actions/delete-package-versions@v1 @@ -95,7 +104,11 @@ To delete multiple specifc versions of a package set __package-version-ids__ to ### Delete multiple specific versions from a package hosted in a different repo than the workflow -To delete multiple specifc versions of a package set __package-version-ids__ to a comma separated string of package version ids. Package version ids can be retrieved via the [GitHub GraphQL API][api]. The token input is required to delete a version of a package hosted in a different repo than the workflow. The [token][token] only needs the delete packages scope. It is recommended [to store the token as a secret][secret]. In this example the [token][token] was stored as a secret named __GITHUB_PAT__. +To delete multiple specifc versions from a package that is hosted in a different repo than the one executing the workflow the __package-version-ids__, and __token__ inputs are required. + +The __package-version-ids__ input should be a comma separated string of package version ids. Package version ids can be retrieved via the [GitHub GraphQL API][api]. + +The [token][token] only needs the delete packages scope. It is recommended [to store the token as a secret][secret]. In this example the [token][token] was stored as a secret named __GITHUB_PAT__. ```yaml - uses: actions/delete-package-versions@v1 @@ -104,7 +117,34 @@ To delete multiple specifc versions of a package set __package-version-ids__ to token: ${{ secrets.GITHUB_PAT }} ``` +
+### Delete oldest version from a package hosted in the same repo as the workflow + +To delete the oldest version from a package that is hosted in the same repo that is executing the workflow the __package-name__ input is required. + +```yaml +- uses: actions/delete-package-versions@v1 + with: + package-name: 'test-package' +``` + +
+ +### Delete oldest version from a package hosted in a different repo than the workflow + +To delete the oldest version from a package that is hosted in a different repo than the one executing the workflow the __package-name__, __owner__, __repo__, and __token__ inputs are required. + +The [token][token] needs the delete packages and read packages scope. It is recommended [to store the token as a secret][secret]. In this example the [token][token] was stored as a secret named __GITHUB_PAT__. + +```yaml +- uses: actions/delete-package-versions@v1 + with: + owner: 'github' + repo: 'packages' + package-name: 'test-package' + token: ${{ secrets.GITHUB_PAT }} +``` # License