Skip to content

Commit

Permalink
TECH-1001: Using a variable instead of a set name to trigger remote w…
Browse files Browse the repository at this point in the history
…orkflow (#1391)
  • Loading branch information
Fgerthoffert authored Oct 21, 2022
1 parent 4b75d0e commit 6127cda
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion .github/workflows/on-code-change.yml
Original file line number Diff line number Diff line change
Expand Up @@ -291,12 +291,28 @@ jobs:
runs-on: ubuntu-latest
needs: [integration-tests, sonar-analysis, security-scan, vulnerability-scan, build]
steps:
- name: Get branch name
id: branch-name
uses: tj-actions/[email protected]
- name: Preparing variables for remote branch
id: exports
shell: bash
run: |
# If we are in a PR, we use master for the remote branch
# If we are not in a PR, we use the current branch for the remote branch
if [[ "${{ github.event.pull_request.head.ref }}" == "" ]]; then
echo "Currently NOT in a PR: ${{ github.event.pull_request.head.ref }}, using ${{ steps.branch-name.outputs.current_branch }} as remote branch"
echo "remote_branch=${{ steps.branch-name.outputs.current_branch }}" >> $GITHUB_OUTPUT
else
echo "Currently in a PR with head: ${{ github.event.pull_request.head.ref }}, using master as remote branch"
echo "remote_branch=master" >> $GITHUB_OUTPUT
fi
- name: Call Jahia-pack-private
id: trigger-step
uses: jonas-schievink/workflow-proxy@v1
with:
workflow: do-it-all.yml
ref: master
ref: ${{ steps.exports.outputs.remote_branch }}
repo: Jahia/jahia-pack-private
wait-for-completion-timeout: 2h
inputs: '{ "parent_image_tag": "${{needs.build.outputs.image_tag}}" }'
Expand Down

0 comments on commit 6127cda

Please sign in to comment.