Skip to content

Commit

Permalink
Merge pull request #10 from simondeziel/github-tooling
Browse files Browse the repository at this point in the history
GitHub tooling
  • Loading branch information
tomponline authored Feb 15, 2024
2 parents e4b4792 + 1c0d7ab commit 5e49157
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 6 deletions.
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: 2
updates:
- package-ecosystem: "gomod"
directory: "/"
labels: []
schedule:
interval: "weekly"

- package-ecosystem: "github-actions"
directory: "/"
labels: []
schedule:
interval: "weekly"
23 changes: 17 additions & 6 deletions .github/workflows/commits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,29 @@ permissions:
contents: read

jobs:
target-branch:
commits:
permissions:
contents: none
name: Branch target
pull-requests: read # needed for private repos
name: Branch target and CLA
runs-on: ubuntu-22.04
steps:
- name: Check branch target
env:
TARGET: ${{ github.event.pull_request.base.ref }}
TITLE: ${{ github.event.pull_request.title }}
if: ${{ github.actor != 'dependabot[bot]' }}
run: |
set -x
[ "${TARGET}" = "main" ] && exit 0
set -eux
TARGET_FROM_PR_TITLE="$(echo "${TITLE}" | sed -n 's/.*(\(stable-[0-9]\.[0-9]\))$/\1/p')"
if [ -z "${TARGET_FROM_PR_TITLE}" ]; then
TARGET_FROM_PR_TITLE="main"
else
echo "Branch target overridden from PR title"
fi
[ "${TARGET}" = "${TARGET_FROM_PR_TITLE}" ] && exit 0
echo "Invalid branch target: ${TARGET}"
echo "Invalid branch target: ${TARGET} != ${TARGET_FROM_PR_TITLE}"
exit 1
- name: Check if CLA signed
uses: simondeziel/has-signed-canonical-cla@implicit-approval-from-licenses

0 comments on commit 5e49157

Please sign in to comment.