Skip to content

Commit

Permalink
An example bake action (use steps to extract short commits)
Browse files Browse the repository at this point in the history
  • Loading branch information
drmalex07 committed Aug 14, 2024
1 parent a193b48 commit cad45c4
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,14 @@ jobs:
- helloworld
steps:

- id: get_commit_ids
run: >-
echo short_commit=$(cut -b 1-7 <<<$GITHUB_SHA) >> $GITHUB_OUTPUT
echo scripts_short_commit=$(git submodule status scripts | awk '{substr($1,1,7)}') >> $GITHUB_OUTPUT
- run: >-
echo short_commit=$(cut -b 1-7 <<<$GITHUB_SHA) >> $GITHUB_ENV
- run: env | sort
echo ${{ steps.get_commit_ids.short_commit }}
echo ${{ steps.get_commit_ids.scripts_short_commit }}
- uses: actions/checkout@v3

Expand Down Expand Up @@ -91,7 +96,6 @@ jobs:
default.args.git_tags=${{ github.ref_name }}
default.args.git_build_time=${{ github.event.head_commit.timestamp }}
default.tags=ghcr.io/${{ github.repository }}:${{ github.ref_name }}
default.tags=ghcr.io/${{ github.repository }}:${{ env.short_commit }}
- name: Inspect image
run: >-
Expand Down

0 comments on commit cad45c4

Please sign in to comment.