Skip to content

Commit

Permalink
feat(build): bump dependencies for the given branch (#4247)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbyron-sf committed Apr 1, 2022
1 parent 40566b4 commit 28cc49b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/bump_dependencies.yml
Expand Up @@ -11,6 +11,7 @@ jobs:
- uses: spinnaker/bumpdeps@master
with:
ref: ${{ github.event.client_payload.ref }}
baseBranch: ${{ github.event.client_payload.branch }}
key: orcaVersion
repositories: kayenta
mavenRepositoryUrl: https://repo.maven.apache.org/maven2
Expand Down
22 changes: 21 additions & 1 deletion .github/workflows/release.yml
Expand Up @@ -17,6 +17,26 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 0
# Given a tag, determine what branch we are on, so we can bump dependencies in the correct branch
- name: Get Branch
run: |
BRANCHES=$(git branch -r --contains ${{ github.ref }})
echo "BRANCHES is '${BRANCHES}'"
# Check for no branches explicitly...Otherwise echo adds a newline so wc thinks there's
# one branch. And echo -n makes it appears that there's one less branch than there
# actually is.
if [ -z "$BRANCHES" ]; then
echo "exactly one branch required to release orca, but there are none"
exit 1
fi
NUM_BRANCHES=$(($(echo "$BRANCHES" | wc -l)))
echo "NUM_BRANCHES is '${NUM_BRANCHES}'"
if [ $NUM_BRANCHES -ne 1 ]; then
echo "exactly one branch required to release orca, but there are $NUM_BRANCHES ($BRANCHES)"
exit 1
fi
echo "exactly one branch ($BRANCHES)"
echo BRANCH=$BRANCHES >> $GITHUB_ENV
- uses: actions/setup-java@v2
with:
java-version: 11
Expand Down Expand Up @@ -105,4 +125,4 @@ jobs:
with:
token: ${{ secrets.SPINNAKER_GITHUB_TOKEN }}
event-type: bump-dependencies
client-payload: '{"ref": "${{ github.ref }}"}'
client-payload: '{"ref": "${{ github.ref }}", "branch": "${{ env.BRANCH}}"}'

0 comments on commit 28cc49b

Please sign in to comment.