Skip to content

Commit

Permalink
ci: update release ci
Browse files Browse the repository at this point in the history
  • Loading branch information
pengzhen committed Jan 16, 2025
1 parent 5fdaf5c commit a4f046e
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ permissions:
env:
releaseBuild: ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags/') }}
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
TAG_NAME: ${{ github.ref | replace('refs/tags/', '') }}

jobs:

push_image_to_github:
name: Push Docker image to Github
runs-on: ubuntu-latest
permissions: write-all
if: ${{ env.releaseBuild == 'true' }} # Only run this job if releaseBuild is true
steps:
- name: Check out the repo
uses: actions/checkout@v4
Expand All @@ -36,19 +36,10 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ github.repository }}
tags: |
type=semver,pattern={{raw}}
- name: Build and push Docker image
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6

Check warning

Code scanning / CodeQL

Unpinned tag for a non-immutable Action in workflow Medium

Unpinned 3rd party Action 'shisui release image' step
Uses Step
uses 'docker/build-push-action' with ref 'v6', not a pinned commit hash
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ env.REGISTRY }}/${{ github.repository }}:${{ env.TAG_NAME }}

0 comments on commit a4f046e

Please sign in to comment.