Skip to content

Commit db0df63

Browse files
authored
Update GitHub Actions workflow with permissions and concurrency (#420)
1 parent 44796a1 commit db0df63

4 files changed

Lines changed: 64 additions & 10 deletions

File tree

.github/dependabot.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: /
5+
schedule:
6+
interval: weekly
7+
groups:
8+
all:
9+
dependency-type: "production"

.github/workflows/build.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,20 @@ on:
55
schedule:
66
- cron: "0 11 * * *"
77

8+
permissions: {}
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
814
jobs:
915
build:
1016
runs-on: ubuntu-latest
17+
permissions:
18+
contents: write
19+
pull-requests: write
1120
steps:
12-
- uses: jmertic/lfx-landscape-tools@main
21+
- uses: jmertic/lfx-landscape-tools@d34c5300ea55dae32df9fac122a924d2f85fbb87 # 20260415
1322
with:
1423
project_processing: skip
1524
env:
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Auto-merge Dependabot PRs
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
7+
permissions:
8+
contents: write
9+
pull-requests: write
10+
11+
jobs:
12+
dependabot:
13+
runs-on: ubuntu-latest
14+
if: github.actor == 'dependabot[bot]'
15+
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
19+
20+
- name: Approve PR
21+
run: |
22+
gh pr review --approve "${{ github.event.pull_request.number }}"
23+
env:
24+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25+
26+
- name: Enable auto-merge
27+
run: |
28+
gh pr merge \
29+
--squash \
30+
--auto \
31+
"${{ github.event.pull_request.number }}"
32+
env:
33+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/validate.yml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,23 @@ on:
77
- main
88
- master
99

10+
permissions: {}
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
1016
jobs:
1117
validate-landscape:
1218
runs-on: ubuntu-latest
1319
name: "Validate landscape.yml file"
20+
permissions:
21+
contents: read
1422
steps:
15-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
16-
- uses: cncf/landscape2-validate-action@7f299c46e9b03b4e8bc2896882734fb0b0756b37 # v2.0.0
23+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
24+
with:
25+
persist-credentials: false
26+
- uses: cncf/landscape2-validate-action@6381e8747c73412e638670807b402ef2b863e9f8 # v2.0.1
1727
with:
1828
target_kind: data
1929
target_path: ./landscape.yml
20-
- uses: pascalgn/automerge-action@7961b8b5eec56cc088c140b56d864285eabd3f67 # v0.16.4
21-
if: success()
22-
env:
23-
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
24-
MERGE_LABELS: "automated-build"
25-
MERGE_RETRY_SLEEP: 300000
26-
MERGE_METHOD: "squash"

0 commit comments

Comments
 (0)