Skip to content

Commit

Permalink
Merge pull request #23 from bcgov-nr/fix/branchSupport
Browse files Browse the repository at this point in the history
fix: branch for dispatch and pr
  • Loading branch information
GraceRuan authored Feb 16, 2024
2 parents b439b8f + d1df50a commit 7085029
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions generator-nr-maven-build/generators/app/templates/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
outputs:
project_version: ${{ steps.set-build-output-parameters.outputs.project_version }}
intention_id: ${{ steps.set-intention-id.outputs.intention_id }}
branch: ${{ steps.set-branch-ci.outputs.branch }}
branch: ${{ steps.set-branch-dispatch.outputs.branch || steps.set-branch-pr.outputs.branch }}

steps:
- uses: actions/checkout@v4
Expand All @@ -46,12 +46,19 @@ jobs:
server-password: ARTIFACTORY_PASSWORD

# Get branch for manual runs
- name: Get branch
id: set-branch-ci
- name: Get branch
id: set-branch-dispatch
if: ${{ startsWith(github.ref, 'refs/heads/') }}
run: |
echo "branch=${{ github.ref_name }}" >> "$GITHUB_OUTPUT"
# Get branch for pull requests
- name: Get branch
id: set-branch-pr
if: ${{ startsWith(github.ref, 'refs/pull/') }}
run: |
echo "branch=${{ github.head_ref }}" >> "$GITHUB_OUTPUT"
- name: Set build output parameters
id: set-build-output-parameters
run: |
Expand Down

0 comments on commit 7085029

Please sign in to comment.