Skip to content

Commit

Permalink
Add job to find current branch
Browse files Browse the repository at this point in the history
  • Loading branch information
ciroque committed Jan 3, 2024
1 parent 027aa9d commit 82b6dfb
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/build-and-sign-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,19 @@ env:
IMAGE_NAME: ${{ github.repository }}

jobs:
find_origin_branch:
runs-on: ubuntu-latest
outputs:
branch: ${{ steps.find_origin_branch.outputs.branch }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Find origin branch
id: find_origin_branch
run: |
echo "::set-output name=branch::$(git branch -r --contains ${{ github.sha }} | grep -v HEAD | sed -e 's/^[[:space:]]*origin\///' | head -n 1)"
build_and_sign_image:
runs-on: ubuntu-latest
permissions:
Expand Down

0 comments on commit 82b6dfb

Please sign in to comment.