Skip to content

Commit

Permalink
Update docker-image.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
kenmuse authored Aug 27, 2024
1 parent 381c22f commit 6c9debd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ permissions:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
REPO_OWNER: ${{ github.event.repository.owner.name }}
REPO_NAME: ${{ github.event.repository.name }}
REPO_ORG: ${{ github.event.organization.login }}

jobs:

Expand All @@ -43,13 +40,16 @@ jobs:
id: versions
env:
AUTH: Bearer ${{ github.token }}
REPO_OWNER: ${{ github.event.repository.owner.name }}
REPO_NAME: ${{ github.event.repository.name }}
REPO_ORG: ${{ github.event.organization.login }}
run: |
$repoOwner = $env:REPO_OWNER
$repoName = $env:REPO_NAME
# The URL is different for personal or organization endpoints, so resolve the correct one
# The org variable should be non-empty and match the owner name if this is an organization.
$packageUrl = ($repoOwner -eq $env:REPO_ORG) ? "https://api.github.com/orgs/$repoOwner/packages/container/$repoName/versions" : "https://api.github.com/users/$repoOwner/packages/container/$repoName/versions"
"Using $packageUrl for $repoOwner / $repoName :: $env:REPO_ORG"
$publishedImageVersions = $((Invoke-WebRequest -Headers @{ "Authorization"=$env:AUTH } -Uri $packageUrl).Content | ConvertFrom-Json) | %{ [PSCustomObject]@{ Id=$_.id; Url=$_.url;Tags=$_.metadata.container.tags } } | %{ $_.tags }
$currentRunnerVersion = ((Invoke-WebRequest -Uri https://api.github.com/repos/actions/runner/releases/latest).Content | ConvertFrom-Json).tag_name -replace 'v',''
$currentHooksVersion = ((Invoke-WebRequest -Uri https://api.github.com/repos/actions/runner-container-hooks/releases/latest).Content | ConvertFrom-Json).tag_name -replace 'v',''
Expand Down

0 comments on commit 6c9debd

Please sign in to comment.