Skip to content

Commit

Permalink
chore: fix up cleanup task
Browse files Browse the repository at this point in the history
  • Loading branch information
joryirving committed Nov 12, 2024
1 parent 5fcce43 commit 6a8a37f
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/get-changed-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ jobs:
name: Get Changed Images
runs-on: ubuntu-latest
outputs:
addedOrModified: "${{ steps.changed-files.outputs.all_changed_and_modified_files_count > 0 }}"
addedOrModifiedImages: "${{ steps.changed-containers.outputs.addedOrModifiedImages }}"
addedOrModified: ${{ steps.changed-files.outputs.all_changed_and_modified_files_count > 0 }}
addedOrModifiedImages: ${{ steps.changed-containers.outputs.addedOrModifiedImages }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/label-sync.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ jobs:
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: "${{ env.BOT_APP_ID }}"
private-key: "${{ env.BOT_APP_PRIVATE_KEY }}"
app-id: ${{ env.BOT_APP_ID }}
private-key: ${{ env.BOT_APP_PRIVATE_KEY }}

- name: Checkout
uses: actions/checkout@v4
with:
token: "${{ steps.app-token.outputs.token }}"
token: ${{ steps.app-token.outputs.token }}

- name: Setup Homebrew
uses: Homebrew/actions/setup-homebrew@master
Expand All @@ -52,6 +52,6 @@ jobs:
- name: Sync Labels
uses: EndBug/label-sync@v2
with:
token: "${{ steps.app-token.outputs.token }}"
token: ${{ steps.app-token.outputs.token }}
config-file: .github/labels.yaml
delete-other-labels: true
2 changes: 1 addition & 1 deletion .github/workflows/pr-validate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ jobs:
uses: joryirving/containers/.github/workflows/build-images.yaml@main
secrets: inherit
with:
appsToBuild: "${{ needs.get-changed-images.outputs.addedOrModifiedImages }}"
appsToBuild: ${{ needs.get-changed-images.outputs.addedOrModifiedImages }}
pushImages: false
sendNotifications: false
2 changes: 1 addition & 1 deletion .github/workflows/release-on-merge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
uses: joryirving/containers/.github/workflows/build-images.yaml@main
secrets: inherit
with:
appsToBuild: "${{ needs.get-changed-images.outputs.addedOrModifiedImages }}"
appsToBuild: ${{ needs.get-changed-images.outputs.addedOrModifiedImages }}
pushImages: true
sendNotifications: true

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/render-readme.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ jobs:
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: "${{ env.BOT_APP_ID }}"
private-key: "${{ env.BOT_APP_PRIVATE_KEY }}"
app-id: ${{ env.BOT_APP_ID }}
private-key: ${{ env.BOT_APP_PRIVATE_KEY }}

- name: Checkout
uses: actions/checkout@v4
with:
token: "${{ steps.app-token.outputs.token }}"
token: ${{ steps.app-token.outputs.token }}

- name: Setup Python
uses: actions/setup-python@v5
Expand All @@ -46,7 +46,7 @@ jobs:

- name: Render README
env:
GITHUB_TOKEN: "${{ steps.app-token.outputs.token }}"
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
shell: bash
run: python ./scripts/render-readme.py

Expand Down
20 changes: 17 additions & 3 deletions .github/workflows/scheduled-cleanup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,21 @@
name: Cleanup untagged images
runs-on: ubuntu-latest
steps:
- name: Get Secrets
uses: bitwarden/sm-action@v2
with:
access_token: ${{ secrets.BW_ACCESS_TOKEN }}
secrets: |
e062dcb9-8cd7-471e-b9be-b10100497102 > BOT_APP_ID
5856238d-3fae-4a0f-9847-b1010049f697 > BOT_APP_PRIVATE_KEY
- name: Generate Token
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ env.BOT_APP_ID }}
private-key: ${{ env.BOT_APP_PRIVATE_KEY }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

Expand All @@ -22,14 +37,13 @@
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
password: ${{ steps.app-token.outputs.token }}

- name: Delete all containers from package without tags
uses: Chizkiyahu/delete-untagged-ghcr-action@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ steps.app-token.outputs.token }}
repository_owner: ${{ github.repository_owner }}
repository: ${{ github.repository }}
untagged_only: true
owner_type: user
except_untagged_multiplatform: true

0 comments on commit 6a8a37f

Please sign in to comment.