Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
8 changes: 3 additions & 5 deletions .github/workflows/shellcheck.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
---
name: 'Run Shellcheck'

on:
push:
branches-ignore:
- 'master'
"on":
- pull_request

jobs:
shellcheck:
name: Shellcheck
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
8 changes: 5 additions & 3 deletions .github/workflows/yamllint.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
---
name: 'Yamllint GitHub Actions'
on:

"on":
- pull_request

jobs:
yamllint:
name: 'Yamllint'
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: yaml-lint
uses: ibiqlik/action-yamllint@v1
uses: ibiqlik/action-yamllint@v3
15 changes: 9 additions & 6 deletions branch-release/branch_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ function increment_version() {
git config --global user.name "github-actions"
git config --global user.email "teamcity@labkey.com"

# Just create release branches if they don't exist
# Just create release branches if they don't exist. Use API to check because branches aren't present in shallow clone.
if ! hub api "repos/{owner}/{repo}/branches/${SNAPSHOT_BRANCH}"; then
# Check to see if TeamCity tagged the wrong branch
AHEAD_DEVELOP="$(hub api "repos/{owner}/{repo}/compare/develop...${GITHUB_SHA}" | grep -oE "${AHEAD_BY_EXP}" | cut -d':' -f 2)"
Expand Down Expand Up @@ -212,7 +212,10 @@ if ! hub api "repos/{owner}/{repo}/branches/${SNAPSHOT_BRANCH}"; then
fi
fi

git fetch --unshallow || true
if [ "$(git rev-parse --is-shallow-repository)" = 'true' ] && ! git fetch --unshallow; then
echo "Failed to unshallow repository. Rerun action." >&2
exit 1
fi

if $SERVER_REPO && [ "$PATCH_NUMBER" == "0" ]; then
echo "Create non-SNAPSHOT branch in server repository for '.0' release"
Expand Down Expand Up @@ -309,7 +312,7 @@ esac

if [ -n "${NEXT_RELEASE:-}" ]; then
TARGET_BRANCH=release${NEXT_RELEASE}-SNAPSHOT
if hub api "repos/{owner}/{repo}/git/refs/heads/${TARGET_BRANCH}"; then
if git rev-parse --verify --quiet "refs/heads/${TARGET_BRANCH}"; then
echo ""
echo "Next ESR release '${TARGET_BRANCH}' exist. Merging ${TAG} to it."
MERGE_BRANCH="${NEXT_RELEASE}_fb_bot_merge_${RELEASE_NUM}"
Expand All @@ -323,10 +326,10 @@ if [ -n "${NEXT_RELEASE:-}" ]; then
# Calculate next monthly release
NEXT_RELEASE="$(increment_version "$NEXT_RELEASE")"
# Check for '.0' tag
if ! git tag -l | grep "${NEXT_RELEASE}.0" ; then
if ! git rev-parse --verify --quiet "refs/tags/${NEXT_RELEASE}.0" ; then
echo "Monthly release ${NEXT_RELEASE}.0 doesn't exist. Check for branch."
TARGET_BRANCH=release${NEXT_RELEASE}-SNAPSHOT
if hub api "repos/{owner}/{repo}/git/refs/heads/${TARGET_BRANCH}"; then
if git rev-parse --verify --quiet "refs/heads/${TARGET_BRANCH}"; then
# 'SNAPSHOT' branch exists but '.0' release hasn't been created. Merge to it!
MERGE_BRANCH="${NEXT_RELEASE}_fb_bot_merge_${RELEASE_NUM}"
else
Expand All @@ -351,7 +354,7 @@ if [ -z "${MERGE_BRANCH:-}" ]; then
MERGE_BRANCH=fb_bot_merge_${RELEASE_NUM}
fi

if hub api "repos/{owner}/{repo}/git/refs/heads/${MERGE_BRANCH}"; then
if git rev-parse --verify --quiet "refs/heads/${MERGE_BRANCH}"; then

RELEASE_DIFF="$(git log --cherry-pick --oneline --no-decorate "origin/${MERGE_BRANCH}..${GITHUB_SHA}" | grep -v -e '^$')"
if [ -z "${RELEASE_DIFF:-}" ]; then
Expand Down
2 changes: 1 addition & 1 deletion branch-release/example.workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Create branches and PRs
uses: labkey-tchad/gitHubActions/branch-release@develop
Expand Down
2 changes: 1 addition & 1 deletion merge-release/example.workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Merge PR
uses: labkey-tchad/gitHubActions/merge-release@develop
Expand Down
Loading