Skip to content

Commit

Permalink
action: fix GHA grabbing the wrong repo name
Browse files Browse the repository at this point in the history
  • Loading branch information
takase1121 committed Sep 15, 2024
1 parent 61d19cd commit e651161
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 1 deletion.
36 changes: 36 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,30 @@ env:
IMAGE_BASE: ${{ github.repository }}

jobs:
update-tag:
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Generate tag
id: tag
shell: bash
run: |
tag="$(git describe --tags $(git rev-list --tags --max-count=1))"
echo "TAG=${tag%%.*}" >> $GITHUB_OUTPUT
- name: Update tag
uses: richardsimko/update-tag@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.tag.outputs.TAG }}

build:
runs-on: ubuntu-latest

Expand Down Expand Up @@ -37,6 +61,12 @@ jobs:
uses: docker/metadata-action@v5
with:
images: ${{ steps.prepare.outputs.IMAGE_NAME }}
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{raw}}
type=semver,pattern=v{{major}}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
Expand Down Expand Up @@ -135,6 +165,12 @@ jobs:
uses: docker/metadata-action@v5
with:
images: ${{ steps.prepare.outputs.IMAGE_NAME }}
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{raw}}
type=semver,pattern=v{{major}}
- name: Log in to the Container registry
uses: docker/login-action@v3
Expand Down
1 change: 0 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ inputs:
image:
description: "Image name."
required: false
default: ghcr.io/${{ github.repository }}-manylinux:latest
volumes:
description: "A list of volumes to mount."
required: false
Expand Down
4 changes: 4 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ main() {
echo -e "${COLOR_RED}error: run and run-args are mutually exclusive.${COLOR_RESET}"
fi

if [[ -z "$INPUT_IMAGE" ]]; then
INPUT_IMAGE="ghcr.io/${GITHUB_ACTION_REPOSITORY:-$GITHUB_REPOSITORY}-manylinux:latest"
fi

# pull the image
if [[ -n "$INPUT_PLATFORM" ]]; then
docker pull -q --platform "$INPUT_PLATFORM" "$INPUT_IMAGE"
Expand Down

0 comments on commit e651161

Please sign in to comment.