Retry Release #138
This file contains hidden or 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
| --- | |
| # yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json | |
| name: Retry Release | |
| on: | |
| schedule: | |
| - cron: "30 1 * * *" | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| apps: | |
| name: Get App Inventory | |
| runs-on: ubuntu-latest | |
| outputs: | |
| apps: ${{ steps.inventory.outputs.apps }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 | |
| with: | |
| persist-credentials: false | |
| - name: Get App Inventory | |
| uses: ./.github/actions/app-inventory | |
| id: inventory | |
| retry: | |
| if: ${{ needs.apps.outputs.apps != '[]' }} | |
| name: Retry Release | |
| runs-on: ubuntu-latest | |
| needs: ["apps"] | |
| strategy: | |
| matrix: | |
| app: ${{ fromJSON(needs.apps.outputs.apps) }} | |
| max-parallel: 4 | |
| fail-fast: false | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 | |
| with: | |
| persist-credentials: false | |
| - name: Install Cosign | |
| uses: sigstore/cosign-installer@7e8b541eb2e61bf99390e1afd4be13a184e9ebc5 # v3.10.1 | |
| - name: Install regctl | |
| uses: regclient/actions/regctl-installer@73d0a55cd4885dc9ce30ce2772a9c01b5753ffef # main | |
| - name: Get Bake Options | |
| id: app-options | |
| uses: ./.github/actions/app-options | |
| with: | |
| app: ${{ matrix.app }} | |
| - name: Get Container Registry Version | |
| id: registry | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| if ! version=$(regctl image inspect ghcr.io/${{ github.repository_owner }}/${{ matrix.app }}:rolling \ | |
| | jq --raw-output '.config.Labels["org.opencontainers.image.version"]' 2>/dev/null) || [[ -z "${version}" ]]; | |
| then | |
| echo "Failed to get registry version for ${{ matrix.app }}" | |
| exit 1 | |
| fi | |
| echo "version=${version}" >> $GITHUB_OUTPUT | |
| - if: ${{ steps.app-options.outputs.version != steps.registry.outputs.version }} | |
| name: Find Pull Request | |
| uses: juliangruber/find-pull-request-action@952b3bb1ddb2dcc0aa3479e98bb1c2d1a922f096 # v1.10.0 | |
| id: find-pull-request | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| labels: app/${{ matrix.app }} | |
| state: open | |
| - if: ${{ steps.find-pull-request.outputs.number != '' }} | |
| name: Retry Release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | # zizmor: ignore[template-injection] | |
| gh workflow run release.yaml \ | |
| --repo ${{ github.repository }} \ | |
| -f app=${{ matrix.app }} \ | |
| -f release=true | |
| { | |
| echo '## Retrying Release' | |
| echo | |
| echo '| Container Name | Actual Version | Expected Version |' | |
| echo '|----------------|------------------|----------------|' | |
| echo '| `${{ matrix.app }}` | `${{ steps.registry.outputs.version }}` | `${{ steps.app-options.outputs.version }}` |' | |
| } >> $GITHUB_STEP_SUMMARY |