Skip to content

Commit c7be1e4

Browse files
authored
Fix branch protections (#9)
* Fix branch protections Add github token to stages to mitigate rate-limiting. Add verify-issue check. Make verify-issue and ci workflows required. Set Repo settings manually. AB#8805
1 parent 87bc86a commit c7be1e4

File tree

2 files changed

+50
-5
lines changed

2 files changed

+50
-5
lines changed

Diff for: .github/workflows/ci.yml

+9-5
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,22 @@ jobs:
1111
steps:
1212
- uses: actions/checkout@v4
1313
- name: Setup go-task
14-
run: |
15-
sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d
16-
echo "${PWD}/bin" >> $GITHUB_PATH
14+
uses: arduino/setup-task@v1
15+
with:
16+
version: 3.x
17+
repo-token: ${{ secrets.GITHUB_TOKEN }}
1718
- name: Setup Go
1819
uses: actions/setup-go@v4
1920
with:
2021
go-version: '1.21.x'
22+
token: ${{ secrets.GITHUB_TOKEN }}
23+
cache-dependency-path: |
24+
datatrails-common-api/go.sum
2125
- name: Setup protobuf
2226
uses: arduino/setup-protoc@v2
2327
with:
2428
version: "24.3"
25-
29+
repo-token: ${{ secrets.GITHUB_TOKEN }}
2630
- name: Generate, Test and Export
2731
run: |
2832
# Note: it is by design that we don't use the builder
@@ -58,4 +62,4 @@ jobs:
5862
gh release upload $TAG swagger.tar.gz
5963
6064
tar -czf go-datatrails-common-api-gen.tar.gz go-datatrails-common-api-gen
61-
gh release upload $TAG go-datatrails-common-api-gen.tar.gz
65+
gh release upload $TAG go-datatrails-common-api-gen.tar.gz

Diff for: .github/workflows/verify-azure-issue.yml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: "Verify Linked Task"
2+
3+
on: [pull_request]
4+
5+
# For details refer to https://github.com/tim-actions/commit-message-checker-with-regex
6+
jobs:
7+
check_pr:
8+
if: ${{ !startsWith(github.head_ref, 'dependabot') && !startsWith(github.head_ref, 'revert-') }}
9+
name: Check Commit Message
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Get PR Commits
13+
id: 'get-pr-commits'
14+
uses: tim-actions/get-pr-commits@master
15+
with:
16+
token: ${{ secrets.GITHUB_TOKEN }}
17+
18+
- name: Check Subject Line Length
19+
uses: tim-actions/[email protected]
20+
with:
21+
commits: ${{ steps.get-pr-commits.outputs.commits }}
22+
pattern: '^.{0,128}(\n.*)*$'
23+
error: 'Subject line too long (suggested 50 chars maximum 128)'
24+
25+
- name: Check Body Line Length
26+
if: ${{ success() || failure() }}
27+
uses: tim-actions/[email protected]
28+
with:
29+
commits: ${{ steps.get-pr-commits.outputs.commits }}
30+
pattern: '^.+(\n.{0,72})*$'
31+
error: 'Body line too long (max 72)'
32+
33+
- name: Check Azure ticket reference
34+
if: ${{ success() || failure() }}
35+
uses: tim-actions/[email protected]
36+
with:
37+
commits: ${{ steps.get-pr-commits.outputs.commits }}
38+
pattern: 'AB#\d{4,5}'
39+
error: 'No Azure ticket reference found'
40+
one_pass_all_pass: 'true'
41+

0 commit comments

Comments
 (0)