Skip to content
This repository has been archived by the owner on Jul 26, 2022. It is now read-only.

Commit

Permalink
check defautl branch
Browse files Browse the repository at this point in the history
Signed-off-by: Markus Maga <markus@maga.se>
  • Loading branch information
Flydiverny committed Mar 18, 2021
1 parent 15191e0 commit 7550de7
Showing 1 changed file with 19 additions and 9 deletions.
28 changes: 19 additions & 9 deletions .github/workflows/build-container.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,26 @@ jobs:
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const result = await github.repos.get(context.repo);
core.info(`test: ${JSON.stringify(result)}`)
core.setOutput('image', 'ghcr.io/external-secrets/kes-dev');
const { default_branch } = await github.repos.get(context.repo);
# - name: Docker meta
# id: docker_meta
# uses: crazy-max/ghaction-docker-meta@v1
# with:
# images: ${{ steps.image_name.outputs.image }}
# tag-sha: true
let imageName = 'kes-dev';
if (default_branch === context.ref.replace('refs/heads/', '')) {
imageName = 'kubernetes-external-secrets';
}
if ('container-in-ci' === context.ref.replace('refs/heads/', '')) {
imageName = 'would-have-changed';
}
core.setOutput('image', `ghcr.io/external-secrets/${imageName}`);
- name: Docker meta
id: docker_meta
uses: crazy-max/ghaction-docker-meta@v1
with:
images: ${{ steps.image_name.outputs.image }}
tag-sha: false

# - name: Login to Docker
# uses: docker/login-action@v1
Expand Down

0 comments on commit 7550de7

Please sign in to comment.