Bump github.com/na4ma4/go-permbits from 0.4.0 to 0.5.0 #4
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Cleanup on Closed Pull Request | |
on: | |
pull_request: | |
types: | |
- closed | |
jobs: | |
# this job will only run if the PR has been merged | |
merge_job: | |
name: "PR was Merged" | |
if: ${{ github.event.pull_request.merged == true }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/delete-package-versions@v5 | |
with: | |
package-name: 'traefik-acme' | |
package-type: 'container' | |
min-versions-to-keep: 0 | |
delete-only-untagged-versions: 'true' | |
- name: Get Version ID from the Versions List | |
id: version-id | |
run: | | |
curl \ | |
-X GET \ | |
-H "X-GitHub-Api-Version: 2022-11-28" \ | |
-H "Accept: application/vnd.github+json" \ | |
-H "Authorization: Bearer ${{secrets.GITHUB_TOKEN}}" \ | |
"${{github.api_url}}/users/${{github.repository_owner}}/packages/container/${{github.event.repository.name}}/versions" >> ${HOME}/versionIds.json | |
echo "VERSION_ID=$(jq -r ".[] | select(.metadata.container.tags | index(\"pr-${{ github.event.pull_request.number }}\")).id" ${HOME}/versionIds.json)" | tee -a "${GITHUB_OUTPUT}" | |
- name: Print Version ID | |
run: echo "The selected Version ID is ${{ steps.version-id.outputs.VERSION_ID }}" | |
- uses: actions/delete-package-versions@v5 | |
if: ${{ steps.version-id.outputs.VERSION_ID != '' }} | |
with: | |
package-name: 'traefik-acme' | |
package-type: 'container' | |
package-version-ids: '${{ steps.version-id.outputs.VERSION_ID }}' | |
# this job will only run if the PR has been closed without being merged | |
close_job: | |
name: "PR was not Merged" | |
if: ${{ github.event.pull_request.merged == false }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/delete-package-versions@v5 | |
with: | |
package-name: 'traefik-acme' | |
package-type: 'container' | |
min-versions-to-keep: 0 | |
delete-only-untagged-versions: 'true' | |
- name: Get Version ID from the Versions List | |
id: version-id | |
run: | | |
curl \ | |
-X GET \ | |
-H "X-GitHub-Api-Version: 2022-11-28" \ | |
-H "Accept: application/vnd.github+json" \ | |
-H "Authorization: Bearer ${{secrets.GITHUB_TOKEN}}" \ | |
"${{github.api_url}}/users/${{github.repository_owner}}/packages/container/${{github.event.repository.name}}/versions" >> ${HOME}/versionIds.json | |
echo "VERSION_ID=$(jq -r ".[] | select(.metadata.container.tags | index(\"pr-${{ github.event.pull_request.number }}\")).id" ${HOME}/versionIds.json)" | tee -a "${GITHUB_OUTPUT}" | |
- name: Print Version ID | |
run: echo "The selected Version ID is ${{ steps.version-id.outputs.VERSION_ID }}" | |
- uses: actions/delete-package-versions@v5 | |
if: ${{ steps.version-id.outputs.VERSION_ID != '' }} | |
with: | |
package-name: 'traefik-acme' | |
package-type: 'container' | |
package-version-ids: '${{ steps.version-id.outputs.VERSION_ID }}' |